var defaultvars = []
defaultvars[0] = 'PeachPuff'
defaultvars[1] = 'LemonChiffon'
defaultvars[2] = 'Olive'
var1=''
var2=''
var3=''




function loadKC()
{

var choice=self.location.toString().split('?');
   if (choice[1])
   {
   var1 = choice[1].split('&')[0];
   var2 = choice[1].split('&')[1];
   var3 = choice[1].split('&')[2];
   }
   if(var1){}else{var1 = defaultvars[0];}
   if(var2){}else{var2 = defaultvars[1];}
   if(var3){}else{var3 = defaultvars[2];}




var oddrows = document.getElementsByTagName('TR');

for(i=0; i<oddrows.length; i++)
 {
 if(oddrows[i].className=='oddrow'){oddrows[i].style.background=var1;}
 else{oddrows[i].style.background=var2;}
 }
mycaption = document.getElementsByTagName('CAPTION');
mytable = document.getElementsByTagName('TABLE');
mycaption[0].style.background = var1;
mycaption[0].style.color = var3;
mytable[0].style.color = var3;

}




function changeexampleframe(newcolor)
{
KNelement = document.getElementsByName('KNwhat')
 if(KNelement[0].checked) {defaultvars[0] = newcolor;}
 if(KNelement[1].checked) {defaultvars[1] = newcolor;}
 if(KNelement[2].checked) {defaultvars[2] = newcolor;}

newsnagurl = 'http://www.secretcorridor.co.uk/snags/knittingchart/snag.html?' + defaultvars[0] + '&' + defaultvars[1] + '&' + defaultvars[2];

newsnagcode = '<textarea style="width:340px; height:135px; background: white none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;IFRAME ID="KNchart" width=120 height=395 src="' + newsnagurl + '" scrolling=no frameborder=no style="overflow:hidden;"&gt;Sorry your browser does not support frames&lt;/IFRAME&gt;</textarea>';

document.getElementById('chartexampleframe').src = newsnagurl
document.getElementById('codebox').innerHTML = newsnagcode;

}




function gotocustomise()
{
window.close();

w = 1000
h = 700
if (window.screen) { 
   w = window.screen.availWidth-80; 
   h = window.screen.availHeight-150; 
   } 

windowvariables = "height="+h+",width="+w+",toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,left=40,top=20";

customisepath='http://secretcorridor.blogspot.com/2009/01/knitting-needle-conversion-chart.html';

homewindow=window.open(customisepath, "commenthome", windowvariables);
homewindow.focus();
}





function gotochartsnag()
{
windowvariables = "height=240,width=500,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,status=no,left=200,top=200";
var chartsnagpath="knittingchartsnag.html"
snagwindow=window.open(chartsnagpath,"calendarsnag",windowvariables);
snagwindow.focus()
}



function gotohome()
{
window.close();

w = 1000
h = 700
if (window.screen) { 
   w = window.screen.availWidth-80; 
   h = window.screen.availHeight-150; 
   } 

windowvariables = "height="+h+",width="+w+",toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,left=40,top=20";

customisepath='http://secretcorridor.com';

homewindow=window.open(customisepath, "commenthome", windowvariables);
homewindow.focus();
}










