// <-----------INITIALIZE BEGINS----------

var kumbhamuser=GetCookie("kumbhamuser");

var flag=GetCookie("flag"); 


function initialize()
{
if(!GetCookie("kumbhamuser")) 
{
kumbhamuser=SetCookie("kumbhamuser","NEW USER",exp);
kumbhamuser=GetCookie("kumbhamuser");
}

if(!GetCookie("email")) 
{
Email=SetCookie("email","jinan@kumbham.org");
Email=GetCookie("email");
}

SetCookie("gatewayopen","N",exp);

if(!GetCookie("gatewayto")) 
SetCookie("gatewayto","index.html",exp);

if(!GetCookie("gatewayfrom")) 
SetCookie("gatewayfrom","www.kumbham.org",exp);

flag=SetCookie("flag",0,exp);
}
// -----------INITIALIZE ENDS---------->

/// color changer begins

function NavIn(menItem,incolor) {
	menItem.style.backgroundColor=incolor;
}

function NavOut(menItem,outcolor) {
	menItem.style.backgroundColor=outcolor;
}
/// menu color changer ends




/////////////menu///////////////
menulist= new Array();
menulist[0]="Architecture, Accessories, Lamps, Wall mountings, Mirror frames, Name board, Structure";
menulist[2]="Eco Tourism, Green gates, Sarovaram, Sradha, Shilparamam, Taj Kumarakam";
menulist[5]="Landscape";
menulist[1]="Murals, Three D Murals, Relief Murals, Flat Murals, Background less Murals, Coil";
menulist[4]="Framed Murals, Birds, Bamboo, Leaves, Figurine, Coil  Murals, Miscellaneous";
menulist[3]="Tiles, Coil Tiles, Plain Tiles, Tiles Application";
menulist[7]="Resort Products";
menulist[6]="Products, House Hold, Kitchen, Container, Office, Sculpture";
menulist[8]="Other Crafts, Dhokra, Bamboo Crafts, Paper Leaf"
menulist[12]="Philosophy";
menulist[9]="Organic Farming";
menulist[10]="About Us";
menulist[11]="Contact Us";
menulist[15]="Links";
menulist[14]="Services";
menulist[13]="Shops";
menulist[16]="Home";

function homemenu()
{
document.writeln("   <table border=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"120\" cellspacing=\"3\">");
for(a=0;a<menulist.length;a++)
{
menumainline=menulist[a].split(',');
document.writeln("        <tr>");
document.writeln("          <td width=\"100%\" bgcolor=\"#D6863F\" align='left'>");
document.writeln("          <a href=\""+menumainline[0].split(' ').join('').toLowerCase()+".html\">&nbsp;<font color='#000000' size='1'>"+menumainline[0]+"</font></a></td>");
document.writeln("        </tr>");
}
document.writeln("      </table>"); 
}

function Menubarrev(m)
{
m.style.backgroundImage="url(images/menu_subbg_rev.gif)"; 
m.style.backgroundRepeat= "repeat-y"; 
m.style.backgroundPosition= "right top";
}

function Menubar(m)
{
m.style.backgroundImage="none"; 
}

titlename=document.title;
titlename=titlename.toUpperCase();

function parentpage()
{
for(a=0;a<menulist.length;a++)
{
menumainline=menulist[a].split(',');
for(b=0;b<menumainline.length;b++)
	{
	if(menumainline[b].split(' ').join('').toLowerCase()==titlename.split(' ').join('').toLowerCase())
	return menumainline[0].split(' ').join('').toLowerCase();
	}
}

}
//window.status='"+menumainline[0].toUpperCase()+"';return true;\"

function menuhomelimit(w)
{
if(document.title!='Home')
{
w=w.split(' ').join('');
document.all.w.style.display='inline'
}
}

function toggle(w)
{
if(w);
}

function menu()
{
// this has to change in the actual page according to the environment..
var parent=parentpage();

document.writeln("<div align=\"center\">");
document.writeln("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" border-color=\"#000000\" width=\"125\"><tr><td width=\"100%\">");
for(a=0;a<menulist.length;a++)
{
menumainline=menulist[a].split(',');

	if(menumainline.length>1)
	{
	document.writeln("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" onClick=\"toggle("+menumainline[0].split(' ').join('')+")\"");
///	if(menumainline[0].split(' ').join('').toLowerCase()!=parent)
///	document.writeln("document.all."+menumainline[0].split(' ').join('')+".style.display='none'");
	w=menumainline[0];
	lin=w.split(' ').join('');
	if(titlename.split(' ').join('').toLowerCase()==w.split(' ').join('').toLowerCase())	
	document.writeln("><tr><td width=\"100%\" style=\"background-image: url('images/menu_rev_bg.gif'); background-repeat: no-repeat; background-position: left; font-size: 10px; font-family: Arial; color: #FFE2C6; \" onClick=\"document.all."+menumainline[0].split(' ').join('')+".style.display='inline'\" ")
	else
	document.writeln("><tr><td width=\"100%\" style=\"background-image: url('images/menu_mainbg.gif'); background-repeat: no-repeat; background-position: left; font-size: 10px; font-family: Arial; color: #FFE2C6; \" onClick=\"if(document.all."+menumainline[0].split(' ').join('')+".style.display=='none') {document.all."+menumainline[0].split(' ').join('')+".style.display='inline'} else {document.all."+menumainline[0].split(' ').join('')+".style.display='none'}\" ");	
	if(menumainline[0].split(' ').join('').toLowerCase()!=parent)
	document.writeln("document.all."+menumainline[0].split(' ').join('')+".style.display='none'");
	document.writeln(">");
	document.writeln("<img border=\"0\" src=\"images/indicator.gif\" width=\"9\" height=\"17\"> ");

	document.writeln("<a href=\""+lin.toLowerCase()+".html\" onMouseOver=\"window.status='"+menumainline[0]+"';return true;\" onMouseOut=\"window.status='';return true;\"> ");
	
		if(titlename.split(' ').join('').toLowerCase()==w.split(' ').join('').toLowerCase())
		document.writeln("<font color=\"#000000\" style=\"font-size:9pt;font-family: Arial;text-decoration: none\">"+w+"</b></font>");
		else
		document.writeln("<font color=\"#FFE2C6\" style=\"font-size:9pt;font-family: Arial;text-decoration: none\">"+w+"</b></font>");
		document.writeln("</font></a>");	
	document.writeln("</td></tr>");
	document.writeln("  <tr><td>");
	document.writeln("              <table cellspacing=\"0\" style="); 
	if(menumainline[0].split(' ').join('').toLowerCase()!=parent)
	document.writeln("\"display:none\"");
	document.writeln(" cellpadding=\"0\" border=\"0\" width=\"100%\" id=\""+menumainline[0].split(' ').join('')+"\" onClick=\"document.all."+menumainline[0].split(' ').join('')+".style.display='inline'\" ");
	document.writeln(">");
	for(b=1;b<menumainline.length;b++)
	{
		document.writeln("            <tr>");
		document.writeln("                  <td width=\"15\" align=\"right\" valign=\"top\"><img border=\"0\" src=\"images/indicator_off.gif\" width=\"9\" height=\"17\"></td>");
		document.writeln("                  <td width=\"110\" onMouseOver='Menubarrev(this);' onMouseOut='Menubar(this);'>");
		w=menumainline[b];
		lin=w.split(' ').join('');
		document.writeln("<a href=\""+lin.toLowerCase()+".html\" onMouseOver=\"window.status='"+menumainline[b]+"';return true;\" onMouseOut=\"window.status='';return true;\"> ");
		if(titlename.split(' ').join('').toLowerCase()==w.split(' ').join('').toLowerCase())
		document.writeln("<font color=\"#000000\" style=\"font-size:9pt;font-family:Arial;font-family: Arial;text-decoration: none\">"+w+"</b></font>");
		else
		document.writeln("<font style=\"font-size:9pt;font-family:Arial;text-decoration: none\">"+w+"</font>");
		document.writeln("</font></a>");
		document.writeln("                </td></tr>");

	}
	document.writeln("              </table>");
	}
	else
	{
	document.writeln("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\" onClick=\"document.all."+menumainline[0].split(' ').join('')+".style.display='inline'\" ");
	w=menumainline[0];
	lin=w.split(' ').join('');
	if(titlename.split(' ').join('').toLowerCase()==w.split(' ').join('').toLowerCase())	
	document.writeln("><tr><td width=\"100%\" style=\"background-image: url('images/menu_rev_bg.gif'); background-repeat: no-repeat; background-position: left; font-size: 10px; font-family: Arial; color: #FFE2C6; \" onClick=\"document.all."+menumainline[0].split(' ').join('')+".style.display='inline'\"")
	else
	document.writeln("><tr><td width=\"100%\" style=\"background-image: url('images/menu_mainbg.gif'); background-repeat: no-repeat; background-position: left; font-size: 10px; font-family: Arial; color: #FFE2C6; \" onClick=\"document.all."+menumainline[0].split(' ').join('')+".style.display='inline'\"");	
	if(menumainline[0].split(' ').join('').toLowerCase()!=parent)
	document.writeln("document.all."+menumainline[0].split(' ').join('')+".style.display='none'");
	document.writeln("> ");
	gotohtml=lin.toLowerCase();
	if(gotohtml=='home')gotohtml='index';
	document.writeln("<font color=\"#000000\"><b>&nbsp;&nbsp;-</b></font><a href=\""+gotohtml+".html\" onMouseOver=\"window.status='"+menumainline[0]+"';return true;\" onMouseOut=\"window.status='';return true;\"> ");
		if(titlename.split(' ').join('').toLowerCase()==w.split(' ').join('').toLowerCase())
		document.writeln("<font  color=\"#000000\" style=\"font-size:9pt;font-family: Arial;text-decoration: none\">"+w+"</b></font>");
		else
		document.writeln("<font color=\"#FFE2C6\" style=\"font-size:9pt;font-family: Arial;text-decoration: none\">"+w+"</b></font>");
		document.writeln("</font></a>");
	document.writeln("  </td></tr>");
	document.writeln("  <tr><td>");
	}
	document.writeln("  </td></tr></table>");
}
document.writeln("  </td></tr></table>");
document.writeln("</div>");
}


//////////////////////////////////
function copyleft()
{
 document.writeln("<center><a href='#' onClick=\"document.all.copyleftnotice.style.visibility='visible';\"><img border=\"0\" src=\"images/copyleft.gif\" width=\"21\" height=\"21\"><br>");
 document.writeln("    <font size=\"1\" color=\"#000000\">copyleft</font></a></center>");
}



function copyleftnotice()
{
document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"4\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\">");
document.writeln("  <tr>");
document.writeln("    <td width=\"20%\" align=\"center\">");
document.writeln("    <img border=\"0\" src=\"images/copyleft.gif\" width=\"83\" height=\"79\"><br>");
document.writeln("    <font face=\"Arial Black\">COPY LEFT</font></td>");
document.writeln("    <td width=\"80%\"><font face=\"Arial\">Human beings have entered the realm of the absurd and");
document.writeln("    unnatural. <br>");
document.writeln("    No one owns knowledge. We are only conduits of knowledge. <br>");
document.writeln("    Nature / The-great-designer of life puts us in the right place at the right");
document.writeln("    time to be the Receivers / Conveyers / Practitioners of knowledge. <br>");
document.writeln("    In a sense, we are all capable of creating. <br>");
document.writeln("    <font size=\"4\"><font color=\"#000000\">Existence is knowledge</font><br>");
document.writeln("    </font>The harm in copying is that we are being unjust to our self, our");
document.writeln("    ability to create, to bloom, to fulfill the mission of life.<br>");
document.writeln("    <br><font color=\"#000000\">If you still want to</font>,<br>go ahead and COPY</font></td>");
document.writeln("  </tr>");
document.writeln("</table>");

}

function sentancecase(w)
{
return w.charAt(0).toUpperCase()+w.substring(1,(w.length)).toLowerCase();
}





function pageopen()
{
if(opencount<2) 
{
document.location="index.html";
}
document.writeln("<div id=\"copyleftnotice\" style=\"position:absolute; width:500; height:300; left:200; top:100; visibility:'hidden'; background-color:#B46B26\">");
document.writeln("<div align=\"center\">");
document.writeln("  <center>");
document.writeln("<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">");
document.writeln("  <tr>");
document.writeln("    <td width=\"100%\">");
document.writeln("  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"300\">");
document.writeln("    <tr>");
document.writeln("      <td width=\"50%\" bgcolor=\"#BE4E03\"><font size=\"2\" color=\"#000000\">&nbsp;&nbsp;COPY LEFT</font></td>");
document.writeln("      <td width=\"50%\" bgcolor=\"#BE4E03\">");
document.writeln("      <p align=\"right\"><b><a href=\"#\" onClick=\"document.all.copyleftnotice.style.visibility='hidden';\">x</a>&nbsp; </b></td>");
document.writeln("    </tr>");
document.writeln("    <tr>");
document.writeln("      <td width=\"100%\" colspan=\"2\" bgcolor=\"B46B26\">");
document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"10\" >");
document.writeln("  <tr>");
document.writeln("    <td width=\"100%\">");
// copyleft();
copyleftnotice();
document.writeln("      </td>");
document.writeln("    </tr>");
document.writeln("  </table>");
document.writeln("      </td>");
document.writeln("    </tr>");
document.writeln("  </table>");
document.writeln("    </td>");
document.writeln("  </tr>");
document.writeln("</table>");
document.writeln("  </center>");
document.writeln("</div>");
document.writeln("</div>");

}

var opencount=amt();

// <-----------VIEWTIMER BEGINS----------
function viewtimes()
{
document.write(opencount);
}
// -----------VIEWTIMER ENDS---------->


// <-----------COOKIE BEGINS---------->
function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}


function SetCookie (name, value) 
{  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}


function DeleteCookie (name) 
{  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);   
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var expDays = 1;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));


function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','2')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}


function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

// -----------COOKIE ENDS---------->

