﻿/***********************************************
* Cross browser Marquee II-
***********************************************/

var delayb4scroll=200; //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=2; //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1; //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////
var copyspeed=marqueespeed;
var pausespeed=(pauseit==0)? copyspeed: 0;
var actualWidth='';

function scrollmarquee(){
	if (parseInt(cross_marquee.style.left)>(actualWidth*(-1)+8)){
		cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px";
	}else{
		cross_marquee.style.left=parseInt(marqueeWidth)+8+"px";
	}
}

function initializemarquee(){
	cross_marquee=document.getElementById("vmarquee");
  if (cross_marquee) {
	cross_marquee.style.left=0;
	marqueeWidth=document.getElementById("marqueecontainer").offsetWidth;
	actualWidth=cross_marquee.offsetWidth;
	if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
		cross_marquee.style.width=marqueeWidth+"px";
		cross_marquee.style.overflow="scroll";
		return
	}
	setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll);
  }
}

if (window.addEventListener){
	window.addEventListener("load", initializemarquee, false);
}else if (window.attachEvent){
	window.attachEvent("onload", initializemarquee);
}else if (document.getElementById){
	window.onload=initializemarquee;
}


/********

*********_______POPPUP__________________****
********/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
		var LeftPosition = '';
		var TopPosition = '';
		var settings = '';
        LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
        TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
        settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
        win = window.open(mypage,myname,settings);
        if(win.window.focus){win.window.focus();}
}/*_____________END OF POPPUP_____________________*/

$(document).ready(function(){

  /**
   * JQUERY update referenced device configurations
   * @abstract
   *
   */
  function UpdateStatToDB(s){
  	//alert('Started! ');
  	$.ajax({
          url: s['url'],
          global: true,
          type: "POST",
          cache: false,
          async: true,
          data: ({ elem_id: s['elem_id'],data:s['data'],actionType:s['actionType'] }),
          dataType: s['dataType'],
          success: function(msg){
          	//alert('Done! ' +  msg);
    	  }
       });
  }


/**
* SEND MAIL
*
*/
    /**
     * SEND mail at dress
     * @return JSON true/false
     *
     */
    jQuery.fn.SendMail1=function(s){
    	$.ajax({
          url: 'prepare_send_mail.php',
          type: 'GET',
          cache: false,
          async: true,
          data: {id:s.dress_id,f:s.fdata},
          dataType: 'json',
          success: function(msg){
           //	s.retv=msg;
    	  },
          complete: function(msg){

    	  }
       });
    }








});
