// JavaScript Document

window . status ='Welcome To SophieSew\'s Softwate And Free Design Download Page ( by Carlos Mandell ).';	

//var http = getHTTPObject(); // lets build our server side posting object.

var OverColor1  = "blue";
var OverColor2  = "red";
var OverColorG  = "green";
var OverColorB  = "black";
var ConfigText  = 'height=100,width=100, top=40, left=40, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no';
var ConfigTextI = 'height=600,width=800, top=40, left=40, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no';

var PathToSSD   = 'ImageURL/ImageWindow.html?Image=SSD.jpg&BC=cc&Per=85&SB=27&File=SophieSew_SetUp_1_13B42&Sub=SSSoftware';

var PathToCD1   = 'ImageURL/ImageWindow.html?Image=CD1.jpg&BC=cc&Per=75&SB=27&File=ChinaDragon&0=10.7!x!23.4!cm&1=_Large&2=8.4!x!17.6!cm&3=_Medium&Sub=ChinaD';
var PathToCDT   = 'ImageURL/ImageWindow.html?Image=CDT.jpg&BC=cc&Per=75&SB=27&File=ChinaDragon&0=10.7!x!23.4!cm&1=_Large&2=8.4!x!17.6!cm&3=_Medium&Sub=ChinaD';  

var PathToSanta  = 'ImageURL/ImageWindow.html?Image=SantaLarge.gif&BC=cc&Per=75&SB=27&File=Santa&0=6.4!x!9.7!cm&1=_Large&2=4.9!x!7.4!cm&3=_Small&Sub=Santa';
var PathToSantaT = 'ImageURL/ImageWindow.html?Image=SantaTShirt.gif&BC=cc&Per=75&SB=27&File=Santa&0=6.4!x!9.7!cm&1=_Large&2=4.9!x!7.4!cm&3=_Small&Sub=Santa';

var PathToCDAT1   = 'ImageURL/ImageWindow.html?Image=DandT.gif&BC=cc&Per=75&SB=27&File=DragonAndTiger&0=9.1!x!15.2!cm&1=_Small&2=14.1!x!23.4!cm&3=_Large&Sub=ChinaDandT';
var PathToCDA1    = 'ImageURL/ImageWindow.html?Image=DandTFrame.jpg&BC=cc&Per=75&SB=27&File=DragonAndTiger&0=9.1!x!15.2!cm&1=_Small&2=14.1!x!23.4!cm&3=_Large&Sub=ChinaDandT';

var PathToSnakeT   = 'ImageURL/ImageWindow.html?Image=SnakeDragonT.gif&BC=cc&Per=75&SB=27&File=DragonSnake&0=9.7!x!17.0!cm&1=_Small&2=13.0!x!22.9!cm&3=_Large&Sub=DragonSnake';
var PathToSnake    = 'ImageURL/ImageWindow.html?Image=SnakeDragon.gif&BC=cc&Per=75&SB=27&File=DragonSnake&0=9.7!x!17.0!cm&1=_Small&2=13.0!x!22.9!cm&3=_Large&Sub=DragonSnake';

var PathToGirlT   = 'ImageURL/ImageWindow.html?Image=GirlInRedTShirt.gif&BC=cc&Per=75&SB=27&File=GirlInRed&0=9.9!x!15.2!cm&1=Small&2=13.9!x!21.4!cm&3=Large&Sub=GirlInRed';
var PathToGirl    = 'ImageURL/ImageWindow.html?Image=GirlInRed.gif&BC=cc&Per=75&SB=27&File=GirlInRed&0=9.9!x!15.2!cm&1=Small&2=13.9!x!21.4!cm&3=Large&Sub=GirlInRed';

var PathToDogT   = 'ImageURL/ImageWindow.html?Image=DogInSnowTShirt.gif&BC=cc&Per=85&SB=27&File=DogInSnow&0=9.8!x!9.3!cm&1=Small&2=13.0!x!12.3!cm&3=Large&Sub=DogAtChristmas';

var PathToDog    = 'ImageURL/ImageWindow.html?Image=DogInSnow.gif&BC=cc&Per=85&SB=27&File=DogInSnow&0=9.8!x!9.3!cm&1=Small&2=13.0!x!12.3!cm&3=Large&Sub=DogAtChristmas';


var PathToNDS1    = 'ImageURL/ImageWindow.html?Image=SunSwirl.gif&BC=cc&Per=75&SB=27&File=SunSwirl&0=15.0!x!15.0!cm&1=_Large&Sub=SunSwirl';
var PathToNDS2    = 'ImageURL/ImageWindow.html?Image=CelticStar.gif&BC=cc&Per=75&SB=27&File=CelticStar&0=15.0!x!15.0!cm&1=_Large&Sub=CelticStar';
var PathToNDS3    = 'ImageURL/ImageWindow.html?Image=Swirl2.gif&BC=cc&Per=75&SB=27&File=Vines&0=15.0!x!15.0!cm&1=_Large&Sub=HeartsAndVines';
var PathToNDS4    = 'ImageURL/ImageWindow.html?Image=HeartsAndVines.gif&BC=cc&Per=75&SB=27&File=HeartsAndVines&0=15.0!x!15.0!cm&1=_Large&Sub=HeartsAndVines';
var PathToNDS5    = 'ImageURL/ImageWindow.html?Image=Swirl.gif&BC=cc&Per=75&SB=27&File=Swirl&0=14.9!x!14.9!cm&1=_Large&Sub=Swirl';
var PathToNDS6    = 'ImageURL/ImageWindow.html?Image=ReverseSwirl.gif&BC=cc&Per=75&SB=27&File=ReverseSwirl&0=14.9!x!14.9!cm&1=_Large&Sub=Swirl';



function SetButtonMenu ()
{
	var Y      = 5;
	var XBase  = 14; 
	var XAdd   = 30 + 7;
	
	
	myInfoA      . Generate ();
	myInfoB      . Generate ();
	myInfoC      . Generate ();
	myInfoCom    . Generate ();
	myInfoSn     . Generate ();
	myInfoGR     . Generate ();
	myInfoSD     . Generate ();
	myInfoSwirl  . Generate ();
	
	
	myInfoA . SetBuffers ( 8 );
	myInfoA . LogButton ( 16                , Y, "BI.gif", "BIH.gif", "BIDH.gif", "BIDH.gif",80, 30, JCGotoDandTInfo ,0 );
	myInfoA . LogButton ( 16 + 88, Y, "BUp.gif", "BUpH.gif", "BupDH.gif", "BUpDH.gif",30, 30, ClickResponseToTop ,0 );
	
	myInfoB . SetBuffers ( 8 );
	myInfoB . LogButton ( 16                , Y, "BI.gif", "BIH.gif", "BIDH.gif", "BIDH.gif",80, 30, JCGotoDragonInfo ,0 );
	myInfoB . LogButton ( 16 + 88, Y, "BUp.gif", "BUpH.gif", "BupDH.gif", "BUpDH.gif",30, 30, ClickResponseToTop ,0 );
	
	myInfoC . SetBuffers ( 8 );
	myInfoC . LogButton ( 16                , Y, "BI.gif", "BIH.gif", "BIDH.gif", "BIDH.gif",80, 30, JCGotoSantaInfo ,0 );
	myInfoC . LogButton ( 16 + 88, Y, "BUp.gif", "BUpH.gif", "BupDH.gif", "BUpDH.gif",30, 30, ClickResponseToTop ,0 );
	
	myInfoCom . SetBuffers ( 8 );
	myInfoCom . LogButton ( 16                , Y, "BI.gif", "BIH.gif", "BIDH.gif", "BIDH.gif",80, 30, JCGotoProgramInfo ,0 );
	myInfoCom . LogButton ( 16 + 88, Y, "BUp.gif", "BUpH.gif", "BupDH.gif", "BUpDH.gif",30, 30, ClickResponseToTop ,0 );
	
	myInfoSn . SetBuffers ( 8 );
	myInfoSn . LogButton ( 16                , Y, "BI.gif", "BIH.gif", "BIDH.gif", "BIDH.gif",80, 30, JCGotoSnakeInfo ,0 );
	myInfoSn . LogButton ( 16 + 88, Y, "BUp.gif", "BUpH.gif", "BupDH.gif", "BUpDH.gif",30, 30, ClickResponseToTop ,0 );
	
	myInfoGR . SetBuffers ( 8 );
	myInfoGR . LogButton ( 16                , Y, "BI.gif", "BIH.gif", "BIDH.gif", "BIDH.gif",80, 30, JCGotoGirlInfo ,0 );
	myInfoGR . LogButton ( 16 + 88, Y, "BUp.gif", "BUpH.gif", "BupDH.gif", "BUpDH.gif",30, 30, ClickResponseToTop ,0 );
	
	myInfoSD . SetBuffers ( 8 );
	myInfoSD . LogButton ( 16                , Y, "BI.gif", "BIH.gif", "BIDH.gif", "BIDH.gif",80, 30, JCGotoDogInfo ,0 );
	myInfoSD . LogButton ( 16 + 88, Y, "BUp.gif", "BUpH.gif", "BupDH.gif", "BUpDH.gif",30, 30, ClickResponseToTop ,0 );
	
	
	myInfoSwirl . SetBuffers ( 8 );
	myInfoSwirl . LogButton ( 16                , Y, "BI.gif", "BIH.gif", "BIDH.gif", "BIDH.gif",80, 30, JCGotoSwirlInfo ,0 );
	myInfoSwirl . LogButton ( 16 + 88, Y, "BUp.gif", "BUpH.gif", "BupDH.gif", "BUpDH.gif",30, 30, ClickResponseToTop ,0 );
	
	
}

function ClickDummy ()
{
	
}

function JCGotoURL ( Path) { //v3.0

	//var Conf = 'height=' + String ( Hei ) + 'height=100,width=100, top=40, left=40, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, directories=no, status=no';
  window.open ( Path , 'newwindow', config=ConfigText );
}

//eval(object + '.style.color = "orange"');

function JCGotoNDS1 ( Path )
{
  window.open ( PathToNDS1 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoNDS2 ( Path )
{
  window.open ( PathToNDS2 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoNDS3 ( Path )
{
  window.open ( PathToNDS3 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoNDS4 ( Path )
{
  window.open ( PathToNDS4 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoNDS5 ( Path )
{
  window.open ( PathToNDS5 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoNDS6 ( Path )
{
  window.open ( PathToNDS6 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoCDSnake ( Path )
{
  window.open ( PathToSnake +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoCDSnakeT ( Path )
{
  window.open ( PathToSnakeT +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoCDGirl ( Path )
{
  window.open ( PathToGirl +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoCDDog ( Path )
{
  window.open ( PathToDog +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoCDGirlT ( Path )
{
  window.open ( PathToGirlT +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoCDDogT ( Path )
{
  window.open ( PathToDogT +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}



function JCGotoCDA1 ( Path )
{
  window.open ( PathToCDA1 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}


function JCGotoCDAT1 ( Path )
{
  window.open ( PathToCDAT1 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoCD1 ( Path )
{
  window.open ( PathToCD1 +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoCDT ( Path )
{
  window.open ( PathToCDT +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoSSDownload ( Path )
{
  window.open ( PathToSSD +"&FT=" + "1000", 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoSanta ( Path )
{
  window.open ( PathToSanta +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}

function JCGotoSantaT ( Path )
{
  window.open ( PathToSantaT +"&FT=" + Path, 'newwindow', config=ConfigText );
	//return document.MM_returnValue;
}
function JCGotoDragonInfo ( )
{
  window.open ( 'DragonInfo.html', 'newwindow', config=ConfigTextI );
	//return document.MM_returnValue;
}

function JCGotoDogInfo ( )
{
  window.open ( 'DogInSnowInfo.html', 'newwindow', config=ConfigTextI );
	//return document.MM_returnValue;
}

function JCGotoSwirlInfo ( )
{
  window.open ( 'SwirlInfo.html', 'newwindow', config=ConfigTextI );
	//return document.MM_returnValue;
}

function JCGotoGirlInfo ( )
{
  window.open ( 'GirlInRedInfo.html', 'newwindow', config=ConfigTextI );
	//return document.MM_returnValue;
}

function JCGotoDandTInfo ( )
{
  window.open ( 'DragonAndTigerInfo.html', 'newwindow', config=ConfigTextI );
	//return document.MM_returnValue;
}

function JCGotoSantaInfo ( )
{
  window.open ( 'SantaInfo.html', 'newwindow', config=ConfigTextI );
	//return document.MM_returnValue;
}

function JCGotoSnakeInfo ( )
{
  window.open ( 'SnakeDragon.html', 'newwindow', config=ConfigTextI );
	//return document.MM_returnValue;
}

function JCGotoProgramInfo ( )
{
  window.open ( 'ProgramInfo.html', 'newwindow', config=ConfigTextI );
	//return document.MM_returnValue;
}


function ClickResponseToTop ()
{
  window . scrollTo ( 0, 0 );
}

function JCOver ( Link, Color )
{

  var Obj = new GetJCObject ( Link );
	Obj.style.color=Color;
	Obj.style.cursor="pointer";
	//
}

function JCOut ( Link, Color )
{
  var Obj = new GetJCObject ( Link );
	Obj.style.color=Color;
}

function handleHttpResponse() 
{
  if (http.readyState == 4 ) 
	{
    // Split the comma delimited response into an array
    results  = http.responseText.split(",");
    var Val1 = results[ 0 ]; // dont use this but you can get info from php file using it.
		
 	  var Val2 = results[ 1 ];
		
		SetLayerText ( Val2, "Downloads: "+ Val1 );
		
		
  }
}

function GetCounterValues ( Counter, LayerHandle )
{
  
	var Param = "CallType=GetDownloadCounterValue" + "&CounterName=" + Counter + "&ReturnID=" + LayerHandle;
	
	http . open("POST", "ImageURL/ProcessDesignDownloads.php", false );
	
	//Send the proper header infomation along with the request
	
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", Param.length);
  http.setRequestHeader("Connection", "close");
	
	http.onreadystatechange = handleHttpResponse;
  http . send ( Param );
}

function LoadPage ( WinType, Path )
{  
	SetOpacity ( 'CDThumb1'        , 7.0 );
	SetOpacity ( 'CDTThumb1'       , 7.0 );
	SetOpacity ( 'SSDownload'      , 7.0 );	
	SetOpacity ( 'CDThumb2'        , 7.0 );
	SetOpacity ( 'CDTThumb2'       , 7.0 );
	SetOpacity ( 'CDATThumb1'      , 7.0 );
	SetOpacity ( 'CDaTTThumb1'     , 7.0 );
	SetOpacity ( 'CDSnake'         , 7.0 );
	SetOpacity ( 'CDSnakeT'        , 7.0 );
	SetOpacity ( 'CDGirl'          , 7.0 );
	SetOpacity ( 'CDGirlT'         , 7.0 );
	SetOpacity ( 'CDDog'           , 7.0 );
	SetOpacity ( 'CDDogT'          , 7.0 );	
	
	SetOpacity ( 'NDS1'          , 7.0 );	
	SetOpacity ( 'NDS2'          , 7.0 );	
	SetOpacity ( 'NDS3'          , 7.0 );	
	SetOpacity ( 'NDS4'          , 7.0 );	
	SetOpacity ( 'NDS5'          , 7.0 );	
	SetOpacity ( 'NDS6'          , 7.0 );
	
	
	SetOpacity ( 'LayerCopywright' , 4.5 );
	
	SetLayersToImageDims ();
	
	//GetCounterValues (  "SophieSew_SetUp_1.03Counter.txt","DSSC1"  );
  //GetCounterValues (  "ChinaDragonCounter_Large.txt","Drag1" );
		
	var FL1= new Image ( 500,789 ); 
  FL1.src="ImageURL/CD1.jpg"; 
	var FL2= new Image ( 700,525 ); 
  FL2.src="ImageURL/CDT.jpg";
	var FL3= new Image ( 530,350 ); 
  FL2.src="ImageURL/SSD.jpg";	
}

function BodyCode ()
{
	centerDiv('LayerMain');
	SetLayerText ( "DSSC1", "Downloads: " + JDD1 );
	SetLayerText ( "Drag1", "Downloads: " + JDD2 );	
	SetLayerText ( "Drag2", "Downloads: " + JDD3 );
	SetLayerText ( "DragA", "Downloads: " + JDD4 );
	SetLayerText ( "Drag3", "Downloads: " + JDD5 );
	SetLayerText ( "DragGirl", "Downloads: " + JDD6 );
	SetLayerText ( "DragDog", "Downloads: " + JDD7 );
	
	SetLayerText ( "DLSunSwirlTitle", "Downloads: " + JDD8 );
	SetLayerText ( "DLCelticStarTitle", "Downloads: " + JDD9 );
	SetLayerText ( "DLSwirl2Title", "Downloads: " + JDD10 );
	SetLayerText ( "DLHeartsAndVineTitle", "Downloads: " + JDD11 );
	SetLayerText ( "DLSwirlTitle", "Downloads: " + JDD12 );
	SetLayerText ( "DLReverseSwirlTitle", "Downloads: " + JDD13 );
	
	RegisterEvents ( "LayerBack1" );
	RegisterEvents ( "LayerBack2" );
	RegisterEvents ( "LayerBackA" );
	RegisterEvents ( "LayerBackSoft" );
	RegisterEvents ( "LayerBack3" );
	RegisterEvents ( "LayerBack4" );
	RegisterEvents ( "LayerBack5" );
	RegisterEvents ( "LayerBackM" );
	
}

function ResetBackground ()
{
  SetOpacity ( "LayerBack1"   , 2.5 );
	SetOpacity ( "LayerBack2"   , 2.5 );
	SetOpacity ( "LayerBack3"   , 2.5 );
	SetOpacity ( "LayerBack4"   , 2.5 );
	SetOpacity ( "LayerBack5"   , 2.5 );
	SetOpacity ( "LayerBackA"   , 2.5 );
	SetOpacity ( "LayerBackSoft", 2.5 );
	SetOpacity ( "LayerBackM"   , 2.5 );
}

