var head="display:''";

function doit(header) {
	var head=header.style;
	if (head.display=="none") {
		head.display="";
	}
	else {
		head.display="none";
	}
}

function ShowPopup(Path,PopupOffer) {
	if (document.all) {
		window.open(Path+'PP='+PopupOffer,PopupOffer,'top=50,left=50,status=0,toolbar=0,menubar=0,location=0,scrollbars=0,resizable=0');
	}
}

function ConfirmClickEvent(FormName, ConfirmMessage) {
	ConfirmMessage = window.confirm(ConfirmMessage);
	if (ConfirmMessage) {
		return true;
	}
	else {
		return false;
	}
}

function ConfirmOpen(OpenURL, ConfirmMessage) {
	ConfirmMessage = window.confirm(ConfirmMessage);
	if (ConfirmMessage) {
		window.open(OpenURL);
	}
	else {
		return false;
	}
}

function WindowResizeMaximum() {
	window.moveTo(0, 0)
	window.resizeTo(screen.availWidth, screen.availHeight);
}

function ConfirmRedirect(RedirectURL, ConfirmMessage) {
	ConfirmMessage = window.confirm(ConfirmMessage);
	if (ConfirmMessage) {
		parent.window.location.href = RedirectURL;
	}
	else {
	}
}

function ConfirmSubject(selectedname) {
		if( selectedname == "Technical Support - Lost Serial Number" ) {
				ConfirmRedirect("serialnumberrecover.asp","Did you know that you can use our ONLINE SERIAL NUMBER RECOVER? \nBy doing so, you will get an INSTANT response instead of waiting until Sienzo Support send you the serial number!!");
		}
		if( selectedname == "Technical Support - Need License File" ) {
				ConfirmRedirect("getlicensefile.asp","Did you know that you can use our ONLINE LICENSE FILE CREATOR? \nBy doing so, you will get an INSTANT response instead of waiting until Sienzo Support send you the license file!!");
		}
		if( selectedname == "Partnering - Affiliate Program" ) {
				ConfirmRedirect("affiliate.asp","Did you know that you could join our affiliate program online? \nBy doing so, you will get an INSTANT response instead of waiting until Sienzo Support as processed our inquery!!");
		}
		if( selectedname == "Technical Support - General (Usage)" ) {
				ConfirmRedirect("faq.asp","Did you read the FAQ? \nBy doing so, you will get an INSTANT response instead of waiting until Sienzo Support as processed our inquery!!");
		}
		if( selectedname == "Technical Support - General (Other)" ) {
				ConfirmRedirect("faq.asp","Did you read the FAQ? \nBy doing so, you will get an INSTANT response instead of waiting until Sienzo Support as processed our inquery!!");
		}
}

function recalculateTotals(check) {
		if( check ) {
			document.getElementById('all_total').innerText = '147.95';
			document.getElementById('rebate_total').innerText = '112.95';
			document.getElementById('savings').innerText = '35.00';
			document.getElementById('productname').value = 'DMM+BIAB+Bundle';
		}
		else
		{
			document.getElementById('all_total').innerText = '59.95';
			document.getElementById('rebate_total').innerText = '49.95';
			document.getElementById('savings').innerText = '10.00';
			document.getElementById('productname').value = 'Sienzo+Digital+Music+Mentor';
		}
}

function goPaypal() {
	if( document.getElementById('rebate_total').innerText == '112.95' )
		window.location = "https://www.paypal.com/xclick?business=paypal@sienzo.com&item_name=DMM+BIAB+Bundle&item_number=100001&amount=112.95&no_note=1&currency_code=USD";
	else
		window.location = "https://www.paypal.com/xclick?business=paypal@sienzo.com&item_name=Sienzo+Digital+Music+Mentor&item_number=100001&amount=49.95&no_note=1&currency_code=USD";
}

function openplayer() 
{ 
	window.open('movieplayer.asp','Movie','width=450,height=450,left=100,top=100,screenX=100,screenY=100,resizable=no'); 
	//window.open('movieplayer.asp','Movie','width=450,height=400,resizable=no'); 
} 

function opendownload()
{
	window.open('downloads.asp?file=DMMSetup.exe','Movie','width=250,height=250,left=100,top=100,screenX=100,screenY=100,resizable=no'); 
}

function Point(x,y) {  this.x = x; this.y = y; }
mouseLocation = new Point(-500,-500);
function getMouseLoc(e)
{
  if(!document.all)  //NS
  {
    mouseLocation.x = e.pageX;
    mouseLocation.y = e.pageY;
  }
  else               //IE
  {
    mouseLocation.x = event.x + document.body.scrollLeft;
    mouseLocation.y = event.y + document.body.scrollTop;
  }
  return true;
}

function getObject( obj ) {

  // step 1
  if ( document.getElementById ) {
    obj = document.getElementById( obj );

  // step 2
  } else if ( document.all ) {
    obj = document.all.item( obj );

  //step 3
  } else {
    obj = null;
  }

  //step 4
  return obj;
  }

function moveObject( obj, e ) {

  // step 1
  var tempX = 0;
  var tempY = 0;
  var offset = 5;
  var objHolder = obj;

  // step 2
  obj = getObject( obj );
  if (obj==null) return;

  // step 3
  if (document.all) {
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {
    tempX = e.pageX;
    tempY = e.pageY;
  }

  // step 4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}

  // step 5
  obj.style.top  = (tempY + offset) + 'px';
  obj.style.left = (tempX + offset) + 'px';

  // step 6
  displayObject( objHolder, true );
  }

  function displayObject( obj, show ) {

  // step 1
  obj = getObject( obj );
  if (obj==null) return;

  // step 2
  obj.style.display = show ? 'block' : 'none';
  obj.style.visibility = show ? 'visible' : 'hidden';
  }


    function closeImageBig() {
        displayObject('divImageBig',false);
        
        document.getElementById('imageBig').src = '/img/ic_loader.gif';
        document.getElementById('imageBigComment').innerHTML = '';
        displayObject('imageBigComment',false);
    }
    
    function showImageBig(url, imagedescription) {
        closeImageBig()
        displayObject('divImageBig',true);
        
        if (imagedescription && imagedescription != '') {
            document.getElementById('imageBigComment').innerHTML = imagedescription;
            displayObject('imageBigComment',true);
        }
        
        var newImage = new Image(); 
        newImage.src = url;
        document.getElementById('imageBig').src = newImage.src;
    }