//THIS SCRIPT IS  POOSAIMANI-PRAPANA.COM
var noofpaint = 0;
var cost = 0;
var checked=true;
var varPurpose="Gift";
//var usdollar=46;

var chnfreight=100;
var outfreight1=300;  // till 16x20 - 320" sq
var outfreight2=500;

var price=new Array();
price[0]="0";
price[1]="2000";
price[2]="2750";
price[3]="3900";
price[4]="5750";
price[5]="6500";
price[6]="9500";

//new standard price

price[7]="12000";
price[8]="16000";
price[9]="22000";

//price[7]="15000";
//price[8]="20000";

//price[51]="3000";
price[51] = new Array("3500","4750","5750","8500","16000","22000");

//price[52]="4000";
price[52] = new Array("4500","7000");

//price[53]="5000";
price[53]= new Array("5750","8500","16000","22000");

price[54]="5000";

price[55]="7000";
//price[56]="7500";
price[56]= new Array("8500","16000","22000");

price[57]="22000";
price[58]="13500";
price[59]="4500"; // lakshmi8
price[60]="6500"; // krishna21
price[61]="8750"; // 5deities
price[62]="17000"; // royal procession

price[64]="9500";
price[65]="7500";

var size = new Array();
size[0]="Select the Size";
size[1]="8 x 10 inches";
size[2]="10 x 12 inches";
size[3]="12 x 15 inches";
size[4]="14 x 18 inches";
size[5]="16 x 20 inches";
size[6]="18 x 24 inches";

size[7]="20 x 26 inches";
size[8]="24 x 30 inches";
size[9]="24 x 36 inches";

//size[7]="24 x 30 inches";
//size[8]="24 x 36 inches";

//size[51] = "15 x 12 inches"; // balaji2 , krishna14
//size[52] = "20 x 12 inches"; // bala 3,4
//size[53] = "20 x 16 inches"; // bhaghavad gita, krishna 4, 12
//size[56] = "24 x 18 inches"; // Meenakshi1 , (bhagawat)

size[51] = new Array("15 x 12 inches","18 x 14 inches","20 x 16 inches","24 x 18 inches","30 x 24 inches","36 x 24 inches"); // balaji2 , krishna14
size[52] = new Array("20 x 12 inches","24 x 15 inches"); // bala 3,4
size[53] = new Array("20 x 16 inches","24 x 18 inches","30 x 24 inches","36 x 24 inches"); // 
size[54] = "24 x 8  inches"; // perumal2
size[55] = "24 x 15 inches"; // krishna16 ,(bala 3,4)
size[56] = new Array("24 x 18 inches","30 x 24 inches","36 x 24 inches"); // Meenakshi1 , (bhagawat)

size[57] = "36 x 24 inches"; // ganesh 14, (NEW) GANESH 21

size[58] = "60 x 12 inches"; // lakshmi 7
size[59] = "20 x 12 inches"; // lakshmi 8  - size same as size[52] - curve - spl price
size[60] = "24 x 15 inches"; // krishna 21 - size same as size[55] - curve - spl price

size[61] = "40 x 10 inches"; // 5deities
size[62] = "36 x 18 inches"; // Royal Procession1
size[63] = "36 x 48 inches"; // krishna 41
size[64] = "28 x 18 inches";//balaji 8
size[65] = "36 x 12 inches";// balaji 11


// lakshmi 8  - 20 x 12 curve 59
// krishna 21 - 24 x 15 curve 60

//Krishna 14 - nonstandard sizes - 15 x 12, 18 x 14, 24 x 18, 20 x 16, 30 x 24

var pname=new Array(175);
var pfile=new Array(175);
var psize=new Array(175);

pname[0] = 'Select the painting';
pfile[0] = 'empty.gif';
psize[0] = 0; // from size code

var pmax=0;

pname[++pmax] = 'Ganesha1';
pfile[pmax] = 'catalogue/ganesh/ganesh1.jpg';
psize[pmax] = 3; 

pname[++pmax] = 'Ganesha2';
pfile[pmax] = "catalogue/ganesh/ganesh2.jpg";
psize[pmax] = 5;

pname[++pmax] ='Ganesha3';
pfile[pmax] = "catalogue/ganesh/ganesh3.jpg";
psize[pmax] = 1;

pname[++pmax] = 'Ganesha4';
pfile[pmax] = "catalogue/ganesh/ganesh4.jpg";
psize[pmax] = 1;

pname[++pmax] = 'Ganesha5';
pfile[pmax] = "catalogue/ganesh/ganesh5.jpg";
psize[pmax] = 3;

pname[++pmax] = 'Ganesha6';
pfile[pmax] = "catalogue/ganesh/ganesh6.jpg";
psize[pmax] = 5;

pname[++pmax] = 'Ganesha7';
pfile[pmax] = "catalogue/ganesh/ganesh7.jpg";
psize[pmax] = 5;

pname[++pmax] = 'Ganesha8';
pfile[pmax] = "catalogue/ganesh/ganesh8.jpg";
psize[pmax] = 3;

pname[++pmax] = 'Ganesha9';
pfile[pmax] = "catalogue/ganesh/ganesh9.jpg";
psize[pmax] = 1;

pname[++pmax] = 'Ganesha10';
pfile[pmax] = "catalogue/ganesh/ganesh10.jpg";
psize[pmax] = 3;

pname[++pmax] = 'Ganesha11';
pfile[pmax] = "catalogue/ganesh/ganesh11.jpg";
psize[pmax] = 1;

pname[++pmax] = 'Ganesha12';
pfile[pmax] = "catalogue/ganesh/ganesh12.jpg";
psize[pmax] = 5;

pname[++pmax] = 'Ganesha13';
pfile[pmax] = "catalogue/ganesh/ganesh13.jpg";
psize[pmax] = 1;

pname[++pmax] = 'Ganesha14';
pfile[pmax] = "catalogue/ganesh/ganesh14.jpg";
psize[pmax] = 57; // 8; // before 57 

pname[++pmax] = 'Ganesha15';
pfile[pmax] = "catalogue/ganesh/ganesh15.jpg";
psize[pmax] = 3

//////////////////////////////
pname[++pmax] = 'Ganesha16';
pfile[pmax] = "catalogue/ganesh/ganesh16.jpg";
psize[pmax] = 5

pname[++pmax] = 'Ganesha17';
pfile[pmax] = "catalogue/ganesh/ganesh17.jpg";
psize[pmax] = 1
///////////////////////////////

/////28 JUNE 2002
pname[++pmax] = 'Ganesha18';
pfile[pmax] = "catalogue/ganesh/ganesh18.jpg";
psize[pmax] = 1

pname[++pmax] = 'Ganesha19';
pfile[pmax] = "catalogue/ganesh/ganesh19.jpg";
psize[pmax] = 3

pname[++pmax] = 'Ganesha20';
pfile[pmax] = "catalogue/ganesh/ganesh20.jpg";
psize[pmax] = 1

pname[++pmax] = 'Ganesha21';
pfile[pmax] = "catalogue/ganesh/ganesh21.jpg";
psize[pmax] = 57

/////28 JUNE 2002

pname[++pmax] = 'Ganesha22';
pfile[pmax] = "catalogue/ganesh/ganesh22.jpg";
psize[pmax] = 5

pname[++pmax] = 'Ganesha23';
pfile[pmax] = "catalogue/ganesh/ganesh23.jpg";
psize[pmax] = 3

pname[++pmax] = 'Ganesha24';
pfile[pmax] = "catalogue/ganesh/ganesh24.jpg";
psize[pmax] = 4

pname[++pmax] = 'Ganesha25';
pfile[pmax] = "catalogue/ganesh/ganesh25.jpg";
psize[pmax] = 9

pname[++pmax] = 'Ganesha26';
pfile[pmax] = "catalogue/ganesh/ganesh26.jpg";
psize[pmax] = 1

pname[++pmax] = 'Ganesha27';
pfile[pmax] = "catalogue/ganesh/ganesh27.jpg";
psize[pmax] = 1

pname[++pmax] = 'Ganesha28';
pfile[pmax] = "catalogue/ganesh/ganesh28.jpg";
psize[pmax] = 5

///25 october 2005

pname[++pmax] = 'Krishna1';
pfile[pmax] = "catalogue/krishna/krishna1.jpg";
psize[pmax] = 5;

pname[++pmax] = 'Krishna2';
pfile[pmax] = "catalogue/krishna/krishna2.jpg";  
psize[pmax] = 1;

pname[++pmax] = 'Krishna3';
pfile[pmax] = "catalogue/krishna/krishna3.jpg";  
psize[pmax] = 1;

pname[++pmax] = 'Krishna4';
pfile[pmax] = "catalogue/krishna/krishna4.jpg";  
psize[pmax] = 53; //fixedsize

pname[++pmax] = 'Krishna5';
pfile[pmax] = "catalogue/krishna/krishna5.jpg";  
psize[pmax] = 1;

pname[++pmax] = 'Krishna6';
pfile[pmax] = "catalogue/krishna/krishna6.jpg";  
psize[pmax] = 2; // before it was in the nonstandard size

pname[++pmax] = 'Krishna7';
pfile[pmax] = "catalogue/krishna/krishna7.jpg"; 
psize[pmax] = 5;

pname[++pmax] = 'Krishna8';
pfile[pmax] = "catalogue/krishna/krishna8.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna9';
pfile[pmax] = "catalogue/krishna/krishna9.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna10';
pfile[pmax] = "catalogue/krishna/krishna10.jpg";  
psize[pmax] = 1;

pname[++pmax] = 'Krishna11';
pfile[pmax] = "catalogue/krishna/krishna11.jpg";  
psize[pmax] = 5;

pname[++pmax] = 'Krishna12';
pfile[pmax] = "catalogue/krishna/krishna12.jpg"; 
psize[pmax] = 53; //fixedsize

pname[++pmax] = 'Krishna131';
pfile[pmax] = "catalogue/krishna/krishna13_1.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Krishna132';
pfile[pmax] = "catalogue/krishna/krishna13_2.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Krishna14';
pfile[pmax] = "catalogue/krishna/krishna14.jpg";  
psize[pmax] = 51; //fixedsize

pname[++pmax] = 'Krishna15';
pfile[pmax] = "catalogue/krishna/krishna15.jpg";  
psize[pmax] = 8; 

pname[++pmax] = 'Krishna16';
pfile[pmax] = "catalogue/krishna/krishna16.jpg";  
psize[pmax] = 55; //fixedsize

pname[++pmax] = 'Krishna17';
pfile[pmax] = "catalogue/krishna/krishna17.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Krishna18';
pfile[pmax] = "catalogue/krishna/krishna18.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Krishna19';
pfile[pmax] = "catalogue/krishna/krishna19.jpg";  
psize[pmax] = 1; 

pname[++pmax] = 'Krishna20';
pfile[pmax] = "catalogue/krishna/krishna20.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Krishna21';
pfile[pmax] = "catalogue/krishna/krishna21.gif";  
psize[pmax] = 60; // 55 //fixedsize; 

pname[++pmax] = 'Krishna22';
pfile[pmax] = "catalogue/krishna/krishna22.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Krishna23';
pfile[pmax] = "catalogue/krishna/krishna23.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Krishna24';
pfile[pmax] = "catalogue/krishna/krishna24.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Krishna25';
pfile[pmax] = "catalogue/krishna/krishna25.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Krishna26';
pfile[pmax] = "catalogue/krishna/krishna26.jpg";  
psize[pmax] = 1; 

pname[++pmax] = 'Krishna27';
pfile[pmax] = "catalogue/krishna/krishna27.jpg";  
psize[pmax] = 5;

///////////////////////////////////
pname[++pmax] = 'Krishna28';
pfile[pmax] = "catalogue/krishna/krishna28.jpg";  
psize[pmax] = 1;

pname[++pmax] = 'Krishna29';
pfile[pmax] = "catalogue/krishna/krishna29.jpg";  
psize[pmax] = 5;

pname[++pmax] = 'Krishna30';
pfile[pmax] = "catalogue/krishna/krishna30.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna31';
pfile[pmax] = "catalogue/krishna/krishna31.jpg";  
psize[pmax] = 9;
///////////////////////////////////

/////28 JUNE 2002
pname[++pmax] = 'Krishna32';
pfile[pmax] = "catalogue/krishna/krishna32.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna33';
pfile[pmax] = "catalogue/krishna/krishna33.jpg";  
psize[pmax] = 2;

pname[++pmax] = 'Krishna34';
pfile[pmax] = "catalogue/krishna/krishna34.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna35';
pfile[pmax] = "catalogue/krishna/krishna35.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna36';
pfile[pmax] = "catalogue/krishna/krishna36.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna37';
pfile[pmax] = "catalogue/krishna/krishna37.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna38';
pfile[pmax] = "catalogue/krishna/krishna38.jpg";  
psize[pmax] = 1;
/////28 JUNE 2002

pname[++pmax] = 'Krishna39';
pfile[pmax] = "catalogue/krishna/krishna39.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna40';
pfile[pmax] = "catalogue/krishna/krishna40.jpg";  
psize[pmax] = 3;

pname[++pmax] = 'Krishna41';
pfile[pmax] = "catalogue/krishna/krishna41.jpg";  
psize[pmax] = 63;

pname[++pmax] = 'Krishna42';
pfile[pmax] = "catalogue/krishna/krishna42.jpg";  
psize[pmax] = 5;

pname[++pmax] = 'Krishna43';
pfile[pmax] = "catalogue/krishna/krishna43.jpg";  
psize[pmax] = 5;

pname[++pmax] = 'Krishna44';
pfile[pmax] = "catalogue/krishna/krishna44.jpg";  
psize[pmax] = 53;

pname[++pmax] = 'Krishna45';
pfile[pmax] = "catalogue/krishna/krishna45.jpg";  
psize[pmax] = 2;

pname[++pmax] = 'Krishna46';
pfile[pmax] = "catalogue/krishna/krishna46.jpg";  
psize[pmax] = 53;


pname[++pmax] = 'Krishna47';
pfile[pmax] = "catalogue/krishna/krishna47.jpg";  
psize[pmax] = 53;

/// 25 october 2005

pname[++pmax] = 'Rama1';
pfile[pmax] = "catalogue/rama/rama1.jpg";  
psize[pmax] = 4; //before it was in the nonstandard size

pname[++pmax] = 'Rama2';
pfile[pmax] = "catalogue/rama/rama2.jpg";  
psize[pmax] = 4; //before it was in the nonstandard size

pname[++pmax] = 'Rama3';
pfile[pmax] = "catalogue/rama/rama3.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Rama4';
pfile[pmax] = "catalogue/rama/rama4.jpg";  
psize[pmax] = 8; 

pname[++pmax] = 'Rama5';
pfile[pmax] = "catalogue/rama/rama5.jpg";  
psize[pmax] = 5; 

///////////////////////////////////
pname[++pmax] = 'Rama6';
pfile[pmax] = "catalogue/rama/rama6.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Rama7';
pfile[pmax] = "catalogue/rama/rama7.jpg";  
psize[pmax] = 8; 

pname[++pmax] = 'Rama8';
pfile[pmax] = "catalogue/rama/rama8.jpg";  
psize[pmax] = 9; 

pname[++pmax] = 'Rama9';
pfile[pmax] = "catalogue/rama/rama9.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Rama10';
pfile[pmax] = "catalogue/rama/rama10.jpg";  
psize[pmax] = 3; 
/////////////////////////////////// 25 October 2005

pname[++pmax] = 'Hanuman1';
pfile[pmax] = "catalogue/hanuman/hanuman1.jpg";
psize[pmax] = 1;

/////////////////////////////////////
pname[++pmax] = 'Hanuman2';
pfile[pmax] = "catalogue/hanuman/hanuman2.jpg";
psize[pmax] = 1;

/////28 JUNE 2002
pname[++pmax] = 'Hanuman3';
pfile[pmax] = "catalogue/hanuman/hanuman3.jpg";
psize[pmax] = 1;

/////28 JUNE 2002

pname[++pmax] = 'Guruvayurappan1';
pfile[pmax] = "catalogue/guruvayur/guruvayur1.jpg";
psize[pmax] = 3;

pname[++pmax] = 'Guruvayurappan2';
pfile[pmax] = "catalogue/guruvayur/guruvayur2.jpg";
psize[pmax] = 3;
/////////////////////////////////////

/////28 JUNE 2002
pname[++pmax] = 'Guruvayurappan3';
pfile[pmax] = "catalogue/guruvayur/guruvayur3.jpg";
psize[pmax] = 3;
/////28 JUNE 2002

pname[++pmax] = 'Balaji1';
pfile[pmax]   = "catalogue/balaji/balaji1.jpg";
psize[pmax]   = 5;

pname[++pmax] = 'Balaji2';
pfile[pmax] = "catalogue/balaji/balaji2.jpg";  
psize[pmax] = 51; //fixedsize

pname[++pmax] = 'Balaji3';
pfile[pmax] = "catalogue/balaji/balaji3.jpg";
psize[pmax] = 52; //fixedsize

pname[++pmax] = 'Balaji4';
pfile[pmax] = "catalogue/balaji/balaji4.jpg";
psize[pmax] = 52; //fixedsize

/////28 JUNE 2002
pname[++pmax] = 'Balaji5';
pfile[pmax] = "catalogue/balaji/balaji5.jpg";
psize[pmax] = 5

pname[++pmax] = 'Balaji6';
pfile[pmax] = "catalogue/balaji/balaji6.jpg";
psize[pmax] = 52; //fixedsize
/////28 JUNE 2002

pname[++pmax] = 'Balaji7';
pfile[pmax] = "catalogue/balaji/balaji7.jpg";
psize[pmax] = 3;


pname[++pmax] = 'Balaji8';
pfile[pmax] = "catalogue/balaji/balaji8.jpg";
psize[pmax] = 64;


pname[++pmax] = 'Balaji9';
pfile[pmax] = "catalogue/balaji/balaji9.jpg";
psize[pmax] = 4;

pname[++pmax] = 'Balaji10';
pfile[pmax] = "catalogue/balaji/balaji10.jpg";
psize[pmax] = 55;

pname[++pmax] = 'Balaji11';
pfile[pmax] = "catalogue/balaji/balaji11.jpg";
psize[pmax] = 65;

/// 25 October 2005

pname[++pmax] = 'Padmavathi1';
pfile[pmax] = "catalogue/padmavathi/padmavathi1.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Padmavathi2';
pfile[pmax] = "catalogue/padmavathi/padmavathi2.jpg";  
psize[pmax] = 8; 

pname[++pmax] = 'Perumal1';
pfile[pmax] = "catalogue/perumal/perumal1.jpg";  
psize[pmax] = 4; 

pname[++pmax] = 'Perumal2';
pfile[pmax] = "catalogue/perumal/perumal2.jpg";  
psize[pmax] = 54; //fixedsize 

pname[++pmax] = 'Uppiliappan1';
pfile[pmax] = "catalogue/uppiliappan/uppiliappan1.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Lakshmi1';
pfile[pmax] = "catalogue/lakshmi/lakshmi1.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Lakshmi2';
pfile[pmax] = "catalogue/lakshmi/lakshmi2.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Lakshmi3';
pfile[pmax] = "catalogue/lakshmi/lakshmi3.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Lakshmi4';
pfile[pmax] = "catalogue/lakshmi/lakshmi4.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Lakshmi5';
pfile[pmax] = "catalogue/lakshmi/lakshmi5.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Lakshmi6';
pfile[pmax] = "catalogue/lakshmi/lakshmi6.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Lakshmi7';
pfile[pmax] = "catalogue/lakshmi/lakshmi7.jpg";  
psize[pmax] = 58; //fixedsize

pname[++pmax] = 'Lakshmi8';
pfile[pmax] = "catalogue/lakshmi/lakshmi8.gif";  
psize[pmax] = 59; // 52; //fixedsize

pname[++pmax] = 'Lakshmi9';
pfile[pmax] = "catalogue/lakshmi/lakshmi9.jpg";  
psize[pmax] = 2;


pname[++pmax] = 'Lakshmi10';
pfile[pmax] = "catalogue/lakshmi/lakshmi10.jpg";  
psize[pmax] = 2;

pname[++pmax] = 'Lakshmi11';
pfile[pmax] = "catalogue/lakshmi/lakshmi11.jpg";  
psize[pmax] = 2;

pname[++pmax] = 'Lakshmi12';
pfile[pmax] = "catalogue/lakshmi/lakshmi12.jpg";  
psize[pmax] = 2;
///25 October 2005


pname[++pmax] = 'Saraswathi1';
pfile[pmax] = "catalogue/saraswathi/saraswathi1.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Saraswathi2';
pfile[pmax] = "catalogue/saraswathi/saraswathi2.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Saraswathi3';
pfile[pmax] = "catalogue/saraswathi/saraswathi3.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Saraswathi4';
pfile[pmax] = "catalogue/saraswathi/saraswathi4.jpg";  
psize[pmax] = 3; 


pname[++pmax] = 'Saraswathi5';
pfile[pmax] = "catalogue/saraswathi/saraswathi5.jpg";  
psize[pmax] = 2; 

pname[++pmax] = 'Saraswathi6';
pfile[pmax] = "catalogue/saraswathi/saraswathi6.jpg";  
psize[pmax] = 2; 

///25 october 2005


pname[++pmax] = 'Andal1';
pfile[pmax]   = 'catalogue/andal/andal1.jpg';
psize[pmax]   = 5; 

pname[++pmax] = 'Andal2';
pfile[pmax]   = 'catalogue/andal/andal2.jpg';
psize[pmax]   = 3; 

pname[++pmax] = 'Murugan1';
pfile[pmax] = "catalogue/muruga/muruga1.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Murugan2';
pfile[pmax] = "catalogue/muruga/muruga2.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Murugan3';
pfile[pmax] = "catalogue/muruga/muruga3.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Murugan4';
pfile[pmax] = "catalogue/muruga/muruga4.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Shiva1';
pfile[pmax] = "catalogue/shiva/shiva1.jpg";  
psize[pmax] = 4; //before it was in the nonstandard size

pname[++pmax] = 'Shiva2';
pfile[pmax] = "catalogue/shiva/shiva2.jpg";  
psize[pmax] = 5; /// 25 october 2005


pname[++pmax] = 'Annapoorni1';
pfile[pmax]   = "catalogue/amman/Annapoorni1.jpg";
psize[pmax]   = 5;

pname[++pmax] = 'Madurai Kaliamman1';
pfile[pmax]   = "catalogue/amman/maduraikaliamman1.jpg";
psize[pmax]   = 3;

pname[++pmax] = 'Lalithambigai1';
pfile[pmax]   = "catalogue/amman/lalithambigai1.jpg";
psize[pmax]   = 2;

pname[++pmax] = 'Gayathri1';
pfile[pmax]   = "catalogue/amman/gayathri1.jpg";
psize[pmax]   = 2;

pname[++pmax] = 'Sharadhadevi1';
pfile[pmax]   = "catalogue/amman/sharadhadevi1.jpg";
psize[pmax]   = 3;

pname[++pmax] = 'Durga1';
pfile[pmax]   = "catalogue/amman/durga1.jpg";
psize[pmax]   = 1;

pname[++pmax] = 'Kamakshi1';
pfile[pmax] = "catalogue/kamatchi/kamatchi1.jpg";
psize[pmax] = 2;

/////28 JUNE 2002
pname[++pmax] = 'Kamakshi2';
pfile[pmax] = "catalogue/kamatchi/kamatchi2.jpg";
psize[pmax] = 2;

pname[++pmax] = 'Kamakshi3';
pfile[pmax] = "catalogue/kamatchi/kamatchi3.jpg";
psize[pmax] = 3;

/////28 JUNE 2002

pname[++pmax] = 'Rajarajeshwari1';
pfile[pmax] = "catalogue/rajarajeshwari/rajarajeshwari1.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Rajarajeshwari2';
pfile[pmax] = "catalogue/rajarajeshwari/rajarajeshwari2.jpg";  
psize[pmax] = 5; 

pname[++pmax] = 'Rajarajeshwari3';
pfile[pmax] = "catalogue/rajarajeshwari/rajarajeshwari3.jpg";  
psize[pmax] = 3; 

//////////////////////////////////////
pname[++pmax] = 'Rajarajeshwari4';
pfile[pmax] = "catalogue/rajarajeshwari/rajarajeshwari4.jpg";  
psize[pmax] = 5; 
//////////////////////////////////////

pname[++pmax] = 'Rajarajeshwari5';
pfile[pmax] = "catalogue/rajarajeshwari/rajarajeshwari5.jpg";  
psize[pmax] = 3; 


pname[++pmax] = 'Meenakshi Kalyanam1';
pfile[pmax] = "catalogue/meenakshi/meenakshi1.jpg";  
psize[pmax] = 56; //fixedsize

pname[++pmax] = 'Meenakshi Kalyanam2';
pfile[pmax] = "catalogue/meenakshi/meenakshi2.jpg";  
psize[pmax] = 3; 

/////////////////////////////////
pname[++pmax] = 'Meenakshi Kalyanam3';
pfile[pmax] = "catalogue/meenakshi/meenakshi3.jpg";  
psize[pmax] = 6; 
/////////////////////////////////

/////28 JUNE 2002
pname[++pmax] = 'Meenakshi Kalyanam4';
pfile[pmax] = "catalogue/meenakshi/meenakshi4.jpg";  
psize[pmax] = 5; 
/////28 JUNE 2002

pname[++pmax] = 'Bhagavad Gita1';
pfile[pmax] = "catalogue/kuru/kuru1.jpg";
psize[pmax] = 53; //fixedsize

pname[++pmax] = 'Bhagavad Gita2';
pfile[pmax] = "catalogue/kuru/kuru2.jpg";
psize[pmax] = 53; //fixedsize

/////28 JUNE 2002
pname[++pmax] = 'Bhagavad Gita3';
pfile[pmax] = "catalogue/kuru/kuru3.jpg";
psize[pmax] = 53; //fixedsize
/////28 JUNE 2002

pname[++pmax] = 'Dasa Avatharam1';
pfile[pmax] = "catalogue/avatharam/avatharam1.jpg";  
psize[pmax] = 6; 

pname[++pmax] = 'Ayyapan1';
pfile[pmax] = "catalogue/iyappa/iyappa1.jpg";
psize[pmax] = 2;

//////////////////////////////////////
pname[++pmax] = 'Ayyapan2';
pfile[pmax] = "catalogue/iyappa/iyappa2.jpg";
psize[pmax] = 2;
//////////////////////////////////////

/////28 JUNE 2002
pname[++pmax] = 'Ayyapan3';
pfile[pmax] = "catalogue/iyappa/iyappa3.jpg";
psize[pmax] = 2;

pname[++pmax] = 'Ayyapan4';
pfile[pmax] = "catalogue/iyappa/iyappa4.jpg";
psize[pmax] = 2;
/////28 JUNE 2002

pname[++pmax] = 'Lakshmi Narasimhan1';
pfile[pmax] = "catalogue/narshima/narshima1.jpg";  
psize[pmax] = 4; 

pname[++pmax] = 'Srinathjee1';
pfile[pmax] = "catalogue/srinathjee/srinathjee1.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Gurunanak1';
pfile[pmax] = "catalogue/gurunanak/gurunanak1.jpg";
psize[pmax] = 1;

pname[++pmax] = 'Saibaba1';
pfile[pmax] = "catalogue/shirdisai/shirdisai1.jpg";  
psize[pmax] = 3; 

pname[++pmax] = 'Mother Mary1';
pfile[pmax] = "catalogue/mary/mary1.jpg";  
psize[pmax] = 1; 

pname[++pmax] = 'Ramanuja1';
pfile[pmax] = "catalogue/ramanuja/ramanuja1.jpg";  
psize[pmax] = 5; 

pname[++pmax] = '5deities';
pfile[pmax] = "catalogue/panels/5deities1.jpg";  
psize[pmax] = 61; 

pname[++pmax] = 'Royal Procession1';
pfile[pmax] = "catalogue/general/procession1.jpg";  
psize[pmax] = 62; 

//var pmax=79;
//var sizemax=9; // no. of std. sizes

var sizemax=10; // no. of std. sizes
var pordmax=5; // no. of paintings that can be ordered

var nstdsizemax=62; // max no. of non std. sizes (51 - 62)

function addpainting()
{
//  document.write('<option value="empty.gif">Select the Painting</option>');
    for(var i=0; i<=pmax; i++)
        document.write('<option value=' + pfile[i] + '>' + pname[i] + '</option>');
}

function addsize()
{
    document.write('<option value="0">Select the Size</option>');
}

function chngsize(x,paintno)
{
if(x != 0)
{
eval('document.mail_order.'+paintno+'_Size.focus()');
}
    if (psize[x] == 0)
    {
        eval('document.mail_order.'+paintno+'_Size.length           = 1');
        eval('document.mail_order.'+paintno+'_Size.options[0].text  = size[psize[x]]');
        eval('document.mail_order.'+paintno+'_Size.options[0].value = psize[x]');
//        eval('document.mail_order.'+paintno+'_Size.options[0].value = size[psize[x]]');
//        document.mail_order.Painting1_Size.value       = size[psize[x]];
        eval('document.mail_order.'+paintno+'_Price.value  = price[psize[x]]');
        eval('document.mail_order.'+paintno+'_Frame.selectedIndex="0"');
    }
    else if(psize[x]>0 && psize[x] <= 50)
    {
        eval('document.mail_order.'+paintno+'_Size.length = sizemax-psize[x]'); 
        eval('document.mail_order.'+paintno+'_Price.value      = price[psize[x]]');
        j=0;
        for(i=psize[x]; i<sizemax; i++)
        {   
           eval('document.mail_order.'+paintno+'_Size.options[j].text  = size[i]');
            eval('document.mail_order.'+paintno+'_Size.options[j].value = size[i]');
            j++;
        }
    }
    else if (psize[x] > 50)
    {   
if( psize[x] == 51 || psize[x] == 52 || psize[x] == 53 || psize[x] == 56)
{
var p=size[psize[x]].length;
        eval('document.mail_order.'+paintno+'_Size.length           = size[psize[x]].length');
for(var i=0;i<p;i++)
{
        eval('document.mail_order.'+paintno+'_Size.options[i].text  = size[psize[x]][i]');
        eval('document.mail_order.'+paintno+'_Size.options[i].value = size[psize[x]][i]');
        eval('document.mail_order.'+paintno+'_Price.value      = price[psize[x]][0]');
}
}
else
{
        eval('document.mail_order.'+paintno+'_Size.length           = 1');
        eval('document.mail_order.'+paintno+'_Size.options[0].text  = size[psize[x]]');
        eval('document.mail_order.'+paintno+'_Size.options[0].value = size[psize[x]]');
        eval('document.mail_order.'+paintno+'_Price.value      = price[psize[x]]');
}
    }
  eval('document.mail_order.'+paintno+'_Size.selectedIndex = "0";'); 

    totalcal();

}

function putprice(valx,paintnum)
{
    eval('document.mail_order.'+paintnum+'_Price.value   = findprice(valx)');
    eval('document.mail_order.'+paintnum+'_Frame.focus()');
    totalcal();
}

function findprice(valx)
{   
    var sizefound=false;
    var retprice=0;
// to check for the array    
    for(i=0; i<sizemax; i++)
    {
        if (size[i] == valx)
        {
            retprice  = price[i];
            sizefound = true;
    return retprice;
        }
    }
    if (!sizefound)
    {
       for(i=51; i<=nstdsizemax; i++)
        {
var len=size[i].length;
for(j=0; j<len; j++)
  {
  if(size[i][j])
  {
   if (size[i][j] == valx)
             {
                    retprice = price[i][j];
                    sizefound = true;
return retprice;
                  }
  }
  else if(size[i])
  {
  if (size[i] == valx)
            {
                retprice = price[i][j];
            sizefound = true;
return retprice;
            }
  }
                 }
  }
    }
    return retprice;
}


function checkempty(paintnumber)
{
var t1= eval('document.mail_order.'+paintnumber+'.options[document.mail_order.'+paintnumber+'.selectedIndex].value');
 if (t1 == "empty.gif" || t1 == 0)
 {
  alert("Please select the "+paintnumber+" Name");
  eval('document.mail_order.'+paintnumber+'_Size.selectedIndex = 0');
  eval('document.mail_order.'+paintnumber+'_Frame.selectedIndex = 0');
  eval('document.mail_order.'+paintnumber+'_Price.value= 0');
  eval('document.mail_order.'+paintnumber+'.focus()');
  return;
 }
 else
 {
 var t2=('document.mail_order.'+paintnumber+'_Size.options[document.mail_order.'+paintnumber+'_Size.selectedIndex].value');
  if(t2 == "0")
  {
    alert("Please select the "+paintnumber+" Size");
    eval('document.mail_order.'+paintnumber+'_Frame.selectedIndex = 0');
    eval('document.mail_order.'+paintnumber+'_Price.value = 0');
    eval('document.mail_order.'+paintnumber+'_Size.focus()');
    totalcal();
    return; 
  }
 }
}

function totalcal()
{  
    var cost=0;
    for(var i=1; i<=pordmax; i++)
        cost =  cost + parseInt(eval('document.mail_order.Painting'+i+'_Price.value'));

    document.mail_order.Total_Cost.value=cost; //"Rs."+cost
    document.mail_order.paint_total.value=cost;
    // document.mail_order.USrate.value=usdollar;
    // document.mail_order.Total_Cost_US.value="$"+Math.round((cost/usdollar));//US DOLLAR CONVERSATION
 
    noofpaint=0;
    for(var i=1; i<=pordmax; i++)
    {
        if (parseInt(eval('document.mail_order.Painting'+i+'_Price.value')) > 0)
            noofpaint=noofpaint+1;
    }
    document.mail_order.Quantity.value=noofpaint;
}

function findcity()
{
    var varcity = document.mail_order.City2.value;
    varcity = alltrim(varcity);
    varcity = varcity.toUpperCase();
    varcity = varcity.substring(0,7);

    var varaddrs22 = document.mail_order.Address22.value;
    varaddrs22    = alltrim(varaddrs22);
    varaddrs22    = varaddrs22.toUpperCase();
    varaddrs22    = varaddrs22.substring(0,7);

    var varaddrs23 = document.mail_order.Address23.value;
    varaddrs23    = alltrim(varaddrs23);
    varaddrs23    = varaddrs23.toUpperCase();
    varaddrs23    = varaddrs23.substring(0,7);

    if (varcity=='CHENNAI' || varcity == 'MADRAS' || varaddrs22 == 'CHENNAI' || varaddrs22 == 'MADRAS' || varaddrs23 == 'CHENNAI' || varaddrs23 == 'MADRAS')
        return true;
    else
        return false;

}

function chkvarsize(varsize) // varsizeZ has to be checked from 1-5, 51-54
{
    var retval = false;
    if(varsize == size[1] || varsize == size[2] || varsize == size[3] || varsize == size[4] || varsize == size[5] || varsize == size[51] || varsize == size[52] || varsize == size[53] || varsize == size[54])
        retval = true;
    return retval;
}

function finaltotal()
{   
    var varsize1    = document.mail_order.Painting1_Size.options[document.mail_order.Painting1_Size.selectedIndex].text;
    var varsize2    = document.mail_order.Painting2_Size.options[document.mail_order.Painting2_Size.selectedIndex].text;
    var varsize3    = document.mail_order.Painting3_Size.options[document.mail_order.Painting3_Size.selectedIndex].text;
    var varsize4    = document.mail_order.Painting4_Size.options[document.mail_order.Painting4_Size.selectedIndex].text;
    var varsize5    = document.mail_order.Painting5_Size.options[document.mail_order.Painting5_Size.selectedIndex].text;

    var ischennai   = findcity();
    
    if(ischennai)
    {   
        document.mail_order.freight_total.value = parseInt(document.mail_order.Quantity.value) * chnfreight;
        document.mail_order.bill_amount.value   = parseInt(document.mail_order.Total_Cost.value) + parseInt(document.mail_order.freight_total.value);
    }
    else
    {        
        var varfreight = 0;
        for(var i=1; i<=pordmax; i++)
        {
            if (eval('document.mail_order.Painting'+i+'_Price.value') != "0") 
            {     
                if(chkvarsize(eval('varsize'+i))) 
                    varfreight = parseInt(varfreight) + parseInt(outfreight1);
                else 
                    varfreight = parseInt(varfreight) + parseInt(outfreight2);
            }
        }
        
        document.mail_order.freight_total.value = varfreight;
        document.mail_order.bill_amount.value   = parseInt(document.mail_order.Total_Cost.value) + parseInt(document.mail_order.freight_total.value);
    }
    
    return;
}

function donotenter(gotopaint)
{
 eval('document.mail_order.'+gotopaint+'.focus()');
 alert("Do not enter any value in this field");
 return;
}

function addcountry()
{ 
    document.write('<option value="Afghanistan"> Afghanistan </option>');
    document.write('<option value="Albania"> Albania </option>');
    document.write('<option value="Algeria"> Algeria  </option>');
    document.write('<option value="American Samoa"> American Samoa </option>'); 
    document.write('<option value="Andorra"> Andorra  </option>');
    document.write('<option value="Angola"> Angola  </option>');
    document.write('<option value="Antarctica"> Antarctica  </option>');
    document.write('<option value="Argentina"> Argentina  </option>');
    document.write('<option value="Armenia"> Armenia  </option>');
    document.write('<option value="Australia"> Australia  </option>');
    document.write('<option value="Austria"> Austria  </option>');
    document.write('<option value="Bahamas ">Bahamas  </option>');
    document.write('<option value="Bahrain ">Bahrain  </option>');
    document.write('<option value="Bangladesh ">Bangladesh  </option>');
    document.write('<option value="Belgium ">Belgium  </option>');
    document.write('<option value="Bermuda ">Bermuda  </option>');
    document.write('<option value="Bhutan ">Bhutan  </option>');
    document.write('<option value="Bolivia ">Bolivia  </option>');
    document.write('<option value="Bosnia and Herzegovina ">Bosnia and Herzegovina  </option>');
    document.write('<option value="Botswana ">Botswana  </option>');
    document.write('<option value="Brazil ">Brazil  </option>');
    document.write('<option value="Brunei ">Brunei  </option>');
    document.write('<option value="Bulgaria ">Bulgaria  </option>');
    document.write('<option value="Cambodia ">Cambodia  </option>');
    document.write('<option value="Cameroon ">Cameroon  </option>');
    document.write('<option value="Canada ">Canada  </option>');
    document.write('<option value="Cape Verde ">Cape Verde  </option>');
    document.write('<option value="Cayman Islands ">Cayman Islands  </option>');
    document.write('<option value="Chile ">Chile  </option>');
    document.write('<option value="China ">China  </option>');
    document.write('<option value="Colombia ">Colombia  </option>');
    document.write('<option value="Comoros ">Comoros  </option>');
    document.write('<option value="Congo ">Congo  </option>');
    document.write('<option value="Cook Islands ">Cook Islands </option>'); 
    document.write('<option value="Costa Rica ">Costa Rica  </option>');
    document.write('<option value="Croatia ">Croatia  </option>');
    document.write('<option value="Cuba ">Cuba  </option>');
    document.write('<option value="Cyprus ">Cyprus  </option>');
    document.write('<option value="Czech Republic ">Czech Republic  </option>');
    document.write('<option value="D.P.R. Korea ">D.P.R. Korea  </option>');
    document.write('<option value="Dem Rep of Congo (Zaire) ">Dem Rep of Congo (Zaire)  </option>');
    document.write('<option value="Denmark ">Denmark  </option>');
    document.write('<option value="Djibouti ">Djibouti  </option>');
    document.write('<option value="Dominica ">Dominica  </option>');
    document.write('<option value="Dominican Republic ">Dominican Republic  </option>');
    document.write('<option value="East Timor ">East Timor  </option>');
    document.write('<option value="Ecuador ">Ecuador  </option>');
    document.write('<option value="Egypt ">Egypt  </option>');
    document.write('<option value="El Salvador ">El Salvador  </option>');
    document.write('<option value="Equatorial Guinea ">Equatorial Guinea  </option>');
    document.write('<option value="Eritrea ">Eritrea  </option>');
    document.write('<option value="Estonia ">Estonia  </option>');
    document.write('<option value="Ethiopia ">Ethiopia  </option>');
    document.write('<option value="Falkland Islands (Malvinas) ">Falkland Islands  </option>');
    document.write('<option value="Faroe Islands ">Faroe Islands  </option>');
    document.write('<option value="Fiji ">Fiji  </option>');
    document.write('<option value="Finland ">Finland  </option>');
    document.write('<option value="France ">France  </option>');
    document.write('<option value="French Guiana ">French Guiana </option>'); 
    document.write('<option value="French Polynesia ">French Polynesia  </option>');
    document.write('<option value="Gabon ">Gabon  </option>');
    document.write('<option value="Gambia ">Gambia  </option>');
    document.write('<option value="Georgia ">Georgia  </option>');
    document.write('<option value="Germany ">Germany  </option>');
    document.write('<option value="Ghana ">Ghana  </option>');
    document.write('<option value="Gibraltar ">Gibraltar  </option>');
    document.write('<option value="Greece ">Greece  </option>');
    document.write('<option value="Greenland ">Greenland  </option>');
    document.write('<option value="Grenada ">Grenada  </option>');
    document.write('<option value="Guadeloupe ">Guadeloupe  </option>');
    document.write('<option value="Guam ">Guam  </option>');
    document.write('<option value="Guatemala ">Guatemala  </option>');
    document.write('<option value="Guinea ">Guinea  </option>');
    document.write('<option value="Guinea-Bissau ">Guinea-Bissau </option>'); 
    document.write('<option value="Guyana ">Guyana  </option>');
    document.write('<option value="Haiti ">Haiti  </option>');
    document.write('<option value="Honduras ">Honduras  </option>');
    document.write('<option value="Hong Kong ">Hong Kong  </option>');
    document.write('<option value="Hungary ">Hungary  </option>');
    document.write('<option value="Iceland ">Iceland  </option>');
    document.write('<option value="India " selected>India  </option>');
    document.write('<option value="Indonesia ">Indonesia  </option>');
    document.write('<option value="Iran ">Iran  </option>');
    document.write('<option value="Iraq ">Iraq  </option>');
    document.write('<option value="Ireland ">Ireland  </option>');
    document.write('<option value="Israel ">Israel  </option>');
    document.write('<option value="Italy ">Italy  </option>');
    document.write('<option value="Jamaica ">Jamaica  </option>');
    document.write('<option value="Japan ">Japan  </option>');
    document.write('<option value="Jordan ">Jordan  </option>');
    document.write('<option value="Kenya ">Kenya  </option>');
    document.write('<option value="Kiribati ">Kiribati  </option>');
    document.write('<option value="Korea ">Korea  </option>');
    document.write('<option value="Kuwait ">Kuwait  </option>');
    document.write('<option value="Kyrgyzstan ">Kyrgyzstan  </option>');
    document.write('<option value="Lao ">Lao  </option>');
    document.write('<option value="Latvia ">Latvia  </option>');
    document.write('<option value="Lebanon ">Lebanon  </option>');
    document.write('<option value="Lesotho ">Lesotho  </option>');
    document.write('<option value="Liberia ">Liberia  </option>');
    document.write('<option value="Libya ">Libya  </option>');
    document.write('<option value="Liechtenstein ">Liechtenstein  </option>');
    document.write('<option value="Lithuania ">Lithuania  </option>');
    document.write('<option value="Luxembourg ">Luxembourg  </option>');
    document.write('<option value="Macao ">Macao  </option>');
    document.write('<option value="Macedonia ">Macedonia  </option>');
    document.write('<option value="Madagascar ">Madagascar  </option>');
    document.write('<option value="Malawi ">Malawi  </option>');
    document.write('<option value="Malaysia ">Malaysia  </option>');
    document.write('<option value="Maldives ">Maldives  </option>');
    document.write('<option value="Mali ">Mali  </option>');
    document.write('<option value="Malta ">Malta  </option>');
    document.write('<option value="Marshall Islands ">Marshall Islands  </option>');
    document.write('<option value="Martinique ">Martinique  </option>');
    document.write('<option value="Mauritania ">Mauritania  </option>');
    document.write('<option value="Mauritius ">Mauritius  </option>');
    document.write('<option value="Mayotte ">Mayotte  </option>');
    document.write('<option value="Mexico ">Mexico  </option>');
    document.write('<option value="Micronesia ">Micronesia  </option>');
    document.write('<option value="Moldova ">Moldova  </option>');
    document.write('<option value="Monaco ">Monaco  </option>');
    document.write('<option value="Mongolia ">Mongolia  </option>');
    document.write('<option value="Montserrat ">Montserrat  </option>');
    document.write('<option value="Morocco ">Morocco  </option>');
    document.write('<option value="Mozambique ">Mozambique  </option>');
    document.write('<option value="Myanmar ">Myanmar  </option>');
    document.write('<option value="Namibia ">Namibia  </option>');
    document.write('<option value="Nauru ">Nauru  </option>');
    document.write('<option value="Nepal ">Nepal  </option>');
    document.write('<option value="Netherlands ">Netherlands  </option>');
    document.write('<option value="Netherlands Antilles ">Netherlands Antilles  </option>');
    document.write('<option value="New Caledonia ">New Caledonia  </option>');
    document.write('<option value="New Zealand ">New Zealand  </option>');
    document.write('<option value="Nicaragua ">Nicaragua  </option>');
    document.write('<option value="Niger ">Niger  </option>');
    document.write('<option value="Nigeria ">Nigeria  </option>');
    document.write('<option value="Niue ">Niue  </option>');
    document.write('<option value="Norfolk Island ">Norfolk Island  </option>');
    document.write('<option value="Norway ">Norway  </option>');
    document.write('<option value="Oman ">Oman  </option>');
    document.write('<option value="Pakistan ">Pakistan  </option>');
    document.write('<option value="Palau ">Palau  </option>');
    document.write('<option value="Panama ">Panama  </option>');
    document.write('<option value="Papua new Guinea ">Papua new Guinea  </option>');
    document.write('<option value="Paraguay ">Paraguay  </option>');
    document.write('<option value="Peru ">Peru  </option>');
    document.write('<option value="Philippines ">Philippines  </option>');
    document.write('<option value="Pitcairn ">Pitcairn  </option>');
    document.write('<option value="Poland ">Poland  </option>');
    document.write('<option value="Portugal ">Portugal  </option>');
    document.write('<option value="Puerto Rico ">Puerto Rico  </option>');
    document.write('<option value="Qatar ">Qatar  </option>');
    document.write('<option value="Reunion ">Reunion  </option>');
    document.write('<option value="Romania ">Romania  </option>');
    document.write('<option value="Russia ">Russia  </option>');
    document.write('<option value="Rwanda ">Rwanda  </option>');
    document.write('<option value="Saint Lucia ">Saint Lucia  </option>');
    document.write('<option value="Samoa ">Samoa  </option>');
    document.write('<option value="San Marino ">San Marino  </option>');
    document.write('<option value="Saudi Arabia ">Saudi Arabia  </option>');
    document.write('<option value="Senegal ">Senegal  </option>');
    document.write('<option value="Seychelles ">Seychelles  </option>');
    document.write('<option value="Sierra Leone ">Sierra Leone  </option>');
    document.write('<option value="Singapore ">Singapore  </option>');
    document.write('<option value="Slovak Republic ">Slovak Republic  </option>');
    document.write('<option value="Slovenia ">Slovenia  </option>');
    document.write('<option value="Solomon Islands ">Solomon Islands  </option>');
    document.write('<option value="Somalia ">Somalia  </option>');
    document.write('<option value="South Africa ">South Africa  </option>');
    document.write('<option value="Spain ">Spain  </option>');
    document.write('<option value="Sri Lanka ">Sri Lanka  </option>');
    document.write('<option value="St Helena ">St Helena  </option>');
    document.write('<option value="Sudan ">Sudan  </option>');
    document.write('<option value="Suriname ">Suriname  </option>');
    document.write('<option value="Swaziland ">Swaziland  </option>');
    document.write('<option value="Sweden ">Sweden  </option>');
    document.write('<option value="Switzerland ">Switzerland  </option>');
    document.write('<option value="Syria ">Syria  </option>');
    document.write('<option value="Taiwan ">Taiwan  </option>');
    document.write('<option value="Tajikistan ">Tajikistan  </option>');
    document.write('<option value="Tanzania ">Tanzania  </option>');
    document.write('<option value="Thailand ">Thailand  </option>');
    document.write('<option value="Tonga ">Tonga  </option>');
    document.write('<option value="Trinidad And Tobago ">Trinidad And Tobago  </option>');
    document.write('<option value="Tunisia ">Tunisia  </option>');
    document.write('<option value="Turkey ">Turkey  </option>');
    document.write('<option value="Turkmenistan ">Turkmenistan  </option>');
    document.write('<option value="Tuvalu ">Tuvalu  </option>');
    document.write('<option value="Uganda ">Uganda  </option>');
    document.write('<option value="Ukraine ">Ukraine  </option>');
    document.write('<option value="United Arab Emirates ">United Arab Emirates  </option>');
    document.write('<option value="United Kingdom ">United Kingdom  </option>');
    document.write('<option value="United States ">United States  </option>');
    document.write('<option value="Uruguay ">Uruguay  </option>');
    document.write('<option value="Uzbekistan ">Uzbekistan  </option>');
    document.write('<option value="Vanuatu ">Vanuatu  </option>');
    document.write('<option value="Vatican City ">Vatican City  </option>');
    document.write('<option value="Venezuela ">Venezuela  </option>');
    document.write('<option value="Vietnam ">Vietnam  </option>');
    document.write('<option value="Virgin Islands ">Virgin Islands </option>'); 
    document.write('<option value="Yemen ">Yemen  </option>');
    document.write('<option value="Yugoslavia ">Yugoslavia  </option>');
    document.write('<option value="Zambia ">Zambia  </option>');
    document.write('<option value="Zimbabwe ">Zimbabwe  </option>');
}

function copyaddress(varPurpose)
{
/*    if(varPurpose=="Personal") 
    { 
        document.mail_order.Deliver_to.value = document.mail_order.Ordered_by.value;
        document.mail_order.Address21.value  = document.mail_order.Address11.value;
        document.mail_order.Address22.value  = document.mail_order.Address12.value;
        document.mail_order.Address23.alue   = document.mail_order.Address13.value;
        document.mail_order.City2.value      = document.mail_order.City1.value;
        document.mail_order.State2.value     = document.mail_order.State1.value;
        document.mail_order.Pincode2.value   = document.mail_order.Pincode1.value;
        document.mail_order.Country2.value   = 'India'; 
        document.mail_order.Telephone2.value = document.mail_order.Telephone1.value;
        document.mail_order.Email2.value     = document.mail_order.Email1.value;
        document.mail_order.Giftmessage.value= "";
        document.mail_order.Order.focus();
        finaltotal();
    }
    else
    {
        document.mail_order.Deliver_to.value = "";
        document.mail_order.Address21.value  = "";
        document.mail_order.Address22.value  = "";
        document.mail_order.Address23.value  = "";
        document.mail_order.City2.value      = ""; 
        document.mail_order.State2.value     = "";
        document.mail_order.Pincode2.value   = "";
        document.mail_order.Country2.value   = 'India';
        document.mail_order.Telephone2.value = "";
        document.mail_order.Email2.value     = "";
        document.mail_order.Deliver_to.focus();
    }
*/
}


function chkpurpose(purposeval)
{   
    if (purposeval=="Gift") 
    {
        varPurpose='Gift'; 
//        copyaddress('Gift'); 
    } 
    else 
    if (purposeval=="Personal")
    {
        varPurpose='Personal'; 
//        copyaddress('Personal'); 
    } 
}


function chkdeliveryvalue()
{
/*    if (varPurpose=='Personal')
    {
        window.alert('You cannot change the value of this field');
        copyaddress(varPurpose);
    }
*/
}


//The user has to atleast select one painting
// function for checking email
function chkemail(emailStr) 
{
    var emailPat=/^(.+)@(.+)$/
    var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
    var validChars="\[^\\s" + specialChars + "\]"
    var quotedUser="(\"[^\"]*\")"
    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
    var atom=validChars + '+'
    var word="(" + atom + "|" + quotedUser + ")"
    var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

    var matchArray=emailStr.match(emailPat)
    if (matchArray==null) 
    {
        alert("Email address seems incorrect (check @ and .'s)")
return false
    }
    var user=matchArray[1];
    var domain=matchArray[2];

    if (user.match(userPat)==null) 
    {
    alert("The username doesn't seem to be valid.")
    return false
    }

    var IPArray=domain.match(ipDomainPat)
    if (IPArray!=null) 
    {
        for (var i=1;i<=4;i++) 
        {
    if (IPArray[i]>255) 
            {
        alert("Destination IP address is invalid!")
return false
    }
        }
        return true
    }

    var domainArray=domain.match(domainPat)
    if (domainArray==null) 
    {
        alert("The domain name doesn't seem to be valid.")
        return false
    }


    var atomPat=new RegExp(atom,"g")
    var domArr=domain.match(atomPat)
    var len=domArr.length
    if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
    {
        alert("The address must end in a three-letter domain, or two letter country.")
        return false
    }

    if (len<2) 
    {
        var errStr="This address is missing a hostname!"
        alert(errStr)
        return false
    }
    return true;
}

// give the length of the string without the spaces
function alltrim(str) 
{
    var retstr="";
    var strlen = str.length;
    for(i=0; i<strlen; i++)
    {
        if (str.charAt(i)!=" ") retstr = retstr + str.charAt(i);
    }
    return retstr; //.length;
}

function chktelephone(telno)
{
    var retval   = true;
    var telvalid = "1234567890+- ";
    var tellen   = telno.length; 
    for (var i=0; i<tellen; i++)
    {
        temp = "" + telno.substring(i, i+1);
  if (telvalid.indexOf(temp) == "-1")
            retval = false;
    }
    return retval;
}


function chkname(name)
{
    var retval       = true;
    var invalidchars = "1234567890`~!@#$%^&*()_=+[{]}\\|;:\'\",<.>/?" ;
    var namelen      = name.length; 
    for (var i=0; i<namelen; i++)
    {
        temp = "" + name.substring(i, i+1);
        if (invalidchars.indexOf(temp) != "-1")
        {    
            retval = false;
        }
    }
    return retval;
}


// function for checking address, etc.,
function checkentry2()
{ 
        if (alltrim(document.mail_order.Ordered_by.value)=="")
        {
            window.alert("NAME cannot be blank"); 
            document.mail_order.Ordered_by.focus();
            return false;
        }
        else
        if (document.mail_order.Ordered_by.value.length<3)
        {
            window.alert("NAME should contain atleast 3 characters");
            document.mail_order.Ordered_by.focus();
            return false;
        }
        else
        {
            if (!chkname(document.mail_order.Ordered_by.value))
            {
                window.alert("Invalid entry! Name can contain only alphabets");
                document.mail_order.Ordered_by.focus();
                return false;
            }      
        }

        if (alltrim(document.mail_order.Address11.value)=="")
        {
            window.alert("ADDRESS1 cannot be blank"); 
            document.mail_order.Address11.focus();
            return false;
        }

/*
        if (alltrim(document.mail_order.Address12.value)=="")
        {
            window.alert("ADDRESS2 cannot be blank"); 
            document.mail_order.Address12.focus();
            return false;
        }

        if (alltrim(document.mail_order.Address13.value)=="")
        {
            window.alert("ADDRESS3 cannot be blank"); 
            document.mail_order.Address13.focus();
            return false;
        }
*/

        if (alltrim(document.mail_order.City1.value)=="")
        {
            window.alert("CITY cannot be blank"); 
            document.mail_order.City1.focus();
            return false;
        }

        if (alltrim(document.mail_order.State1.value)=="")
        {
            window.alert("STATE cannot be blank"); 
            document.mail_order.State1.focus();
            return false;
        }

        if (alltrim(document.mail_order.Pincode1.value)=="") 
        {
            window.alert("POSTAL CODE cannot be blank"); 
            document.mail_order.Pincode1.focus();
            return false;
        }
        else 
        if (isNaN(document.mail_order.Pincode1.value))
        {
            window.alert("POSTAL CODE should contain numbers only");
            document.mail_order.Pincode1.focus();
            return false;
        }

/*        window.alert(document.mail_order.Country1.value);
        if (alltrim(document.mail_order.Country1.value) == "India")
        {
            if (document.mail_order.Pincode1.value.length<6)
            {
                window.alert("POSTAL CODE should contain 6 digits");
                document.mail_order.Pincode1.focus();
                return false;
            }
        }
*/

        if (alltrim(document.mail_order.Telephone1.value)=="")
        {
            window.alert("TELEPHONE Number cannot be blank"); 
            document.mail_order.Telephone1.focus();
            return false;
        }
        else
        {
            if (!chktelephone(document.mail_order.Telephone1.value))
            {
                window.alert("Invalid entry! Telephone number should contain valid characters");
                document.mail_order.Telephone1.focus();
                return false;
            }
        }

        if (chkemail(document.mail_order.Email1.value)==false) 
        {
            document.mail_order.Email1.focus();
            return false;
        }

        if (varPurpose=="Personal" && alltrim(document.mail_order.Giftmessage.value)!="")
        {
            window.alert("GIFT MESSAGE should not be entered for PERSONAL purchase");
            document.mail_order.Giftmessage.value = "";
            document.mail_order.Giftmessage.focus();
        }

//    if (varPurpose=="Gift")
//    {
        if (alltrim(document.mail_order.Deliver_to.value)=="")
        {
            window.alert("NAME cannot be blank"); 
            document.mail_order.Deliver_to.focus();
            return false;
        }
        else
        if (document.mail_order.Deliver_to.value.length<3)
        {
            window.alert("NAME should contain atleast 3 characters");
            document.mail_order.Deliver_to.focus();
            return false;
        }
        else
        {
            if (!chkname(document.mail_order.Deliver_to.value))
            {
                window.alert("Invalid entry! Name can contain only alphabets");
                document.mail_order.Deliver_to.focus();
                return false;
            }
        }

        if (alltrim(document.mail_order.Address21.value)=="")
        {
            window.alert("ADDRESS1 cannot be blank"); 
            document.mail_order.Address21.focus();
            return false;
        }

/*
        if (alltrim(document.mail_order.Address22.value)=="")
        {
            window.alert("ADDRESS2 cannot be blank"); 
            document.mail_order.Address22.focus();
            return false;
        }

        if (alltrim(document.mail_order.Address23.value)=="")
        {
            window.alert("ADDRESS3 cannot be blank"); 
            document.mail_order.Address23.focus();
            return false;
        }

*/

        if (alltrim(document.mail_order.City2.value)=="")
        {
            window.alert("CITY cannot be blank"); 
            document.mail_order.City2.focus();
            return false;
        }

        if (alltrim(document.mail_order.State2.value)=="")
        {
            window.alert("STATE cannot be blank"); 
            document.mail_order.State2.focus();
            return false;
        }

        if (alltrim(document.mail_order.Pincode2.value)=="") 
        {
            window.alert("POSTAL CODE cannot be blank"); 
            document.mail_order.Pincode2.focus();
            return false;
        }
        else 
        if (isNaN(document.mail_order.Pincode2.value))
        {
            window.alert("POSTAL CODE should contain numbers only");
            document.mail_order.Pincode2.focus();
            return false;
        }
        else
        if (document.mail_order.Pincode2.value.length<6)
        {
            window.alert("POSTAL CODE should contain 6 digits");
            document.mail_order.Pincode2.focus();
            return false;
        }

/*        if (alltrim(document.mail_order.Telephone2.value)=="")
        {
            window.alert("TELEPHONE Number cannot be blank"); 
            document.mail_order.Telephone2.focus();
            return false;
        }
*/

        if (alltrim(document.mail_order.Telephone2.value)!="")
        {
            if (!chktelephone(document.mail_order.Telephone2.value))
            {
                window.alert("Invalid entry! Telephone number should contain valid characters");
                document.mail_order.Telephone2.focus();
                return false;
            }
        }


        if (alltrim(document.mail_order.Email2.value)!="" && chkemail(document.mail_order.Email2.value)==false) 
        {
            document.mail_order.Email2.focus();
            return false;
        }

        if (varPurpose=="Gift")
        {
            if (alltrim(document.mail_order.Giftmessage.value)=="")
            {
                window.alert("GIFT MESSAGE should be entered for GIFTs");
                document.mail_order.Giftmessage.focus();
                return false;
            }
        }
        else
        {
            if (alltrim(document.mail_order.Giftmessage.value)!="")
            {
                window.alert("GIFT MESSAGE should not be entered for Personal purchase");
                document.mail_order.Giftmessage.value = "";
                document.mail_order.Giftmessage.focus();
//                return false;
            }
        }       

//    }

    return true;
}

function checkentry1()
{
    if (noofpaint==0)
    {
        window.alert('Please select atleast one painting');
        document.mail_order.Painting1.focus(); 
        return false;
    }

    for(var i = 1; i<=pordmax; i++)
    {    
        var tmppainting = eval('document.mail_order.Painting' + i + '.options[document.mail_order.Painting' + i + '.selectedIndex].value');
        var tmpsize     = eval('document.mail_order.Painting' + i + '_Size.options[document.mail_order.Painting' + i + '_Size.selectedIndex].value');
        var tmpframe    = eval('document.mail_order.Painting' + i + '_Frame.options[document.mail_order.Painting' + i + '_Frame.selectedIndex].value');

        if ((tmppainting != 'empty.gif') && (tmppainting !=0))
        {
            if (tmpsize == '0')
            {
                window.alert(eval('Please select the size for Painting'+i)); 
                eval('document.mail_order.Painting'+i+'_Size.focus()');
                return false;
            }

            if (tmpframe == '0')
            {
                window.alert('Please select the type of frame for Painting'+i); 
                eval('document.mail_order.Painting'+i+'_Frame.focus()');
                return false;
            }
        }

    }

    return true;
}


function validateform()
{
    if(!checkentry1()) return false;
    if(!checkentry2()) return false;
    finaltotal();

    for(var i=1; i<=pordmax; i++)
    {
        var tmppainting = eval('document.mail_order.Painting' + i + '.options[document.mail_order.Painting' + i + '.selectedIndex].value');    
        if(tmppainting == 'empty.gif')
  {
      eval('document.mail_order.Painting'+i+'.options[0].value  = 0');
          }
else
  {
eval('document.mail_order.Painting'+i+'.options[document.mail_order.Painting'+i+'.selectedIndex].value = document.mail_order.Painting'+i+'.options[document.mail_order.Painting'+i+'.selectedIndex].text');
  }
    } 

/*
    for(var i=1;i<=pordmax;i++)
    {
eval('document.mail_order.Painting'+i+'.options[document.mail_order.Painting'+i+'.selectedIndex].value = document.mail_order.Painting'+i+'.options[document.mail_order.Painting'+i+'.selectedIndex].text');
//eval('alert(document.mail_order.Painting'+i+'.options[document.mail_order.Painting'+i+'.selectedIndex].text)');
    }

*/
    window.alert('Thanks for your order!');
    document.mail_order.submit();
}

function resetvalue()
 {
for(var i=1;i<=5;i=i+1)
{
eval('document.mail_order.Painting'+i+'_Size.options[0].value=size[0]');
eval('document.mail_order.Painting'+i+'_Size.options[0].text=size[0]');
eval('document.mail_order.view'+i+'.src="empty.gif"');
}
document.mail_order.Painting1.focus();
 }
