﻿// JScript File

function openImageViewer(imageUrl,width,height)
{
    window.open('ImageViewer.aspx?imageurl='+imageUrl,'ImagerViewrWindow','scrollbars=yes,width='+width+',height='+height);
}
function OpenWindow(url,width,height)
{
    winprops = 'height='+height+',width='+width+',top=150,left=150,scrollbars=yes,resizable=no,menu=no,titlebar=no'
	window.open(url,'popup',winprops)
}
function validateService()
{
    var ddlAppointment = document.getElementById("ddlAppointment")
    if(ddlAppointment.options[ddlAppointment.selectedIndex].text != "Select" && ddlAppointment.options[ddlAppointment.selectedIndex].text != "-----------------------------------------------")
        return true;
    else
    {
        alert('Select Appointment For first!');
        return false;   
    }
}
function validateSpecialOffer()
{
    var ddlSpecialOffer = document.getElementById("ctl00_ContentPlaceHolder1_ddlSpecialOffers")
    if(ddlSpecialOffer.options[ddlSpecialOffer.selectedIndex].text != "Select")
        return true;
    else
    {
        alert('Select Special Offer first!');
        return false;   
    }
}
function ChangeFrame(source)
{
            var obj;
            obj = document.getElementById("myFrame");
	        obj.src = source;
	        
}
var timer;           //¶¨Ê±Æ÷±äÁ¿
var amount = 2;      //ËÙ¶È±äÁ¿£¬Ä¬ÈÏÖµÎª2
var stoped = false;
function initMarquee(marId){
	if(document.getElementById(marId)){
		if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 3)){		
		   document.getElementById(marId).scrollAmount=document.getElementById(marId).clientWidth;
		 }
		 else{
		   document.getElementById(marId).scrollAmount=amount;
		 }		 
	}
}
	
function startMarquee(marId){
    var marObj = document.getElementById(marId);
    marObj.scrollAmount = amount;
    marObj.start(); 
    clearTimeout(timer);  
    stoped = true;
    marObj.onscroll=function(){scrolling(this);};
}
	
function scrollMarquee(marObj, waitTime){	
	if(!stoped && marObj.scrollLeft <= marObj.clientWidth){
	   marObj.stop();	     
	   timer = setTimeout("startMarquee('"+marObj.id+"')", waitTime);
	}
}
function scrolling(marObj){	 
	marObj.stop();
	marObj.scrollAmount = amount;
	marObj.start();
 
}
 function autoIframe(frameId){
    try{
    frame = document.getElementById(frameId);
    innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
    objToResize = (frame.style) ? frame.style : frame;
    objToResize.height = innerDoc.body.scrollHeight + 10+"px";
    }
    catch(err){
    window.status = err.message;
    }
    }
function loadFrame()
{
    
    if (window.parent && window.parent.autoIframe) 
    {
        window.parent.autoIframe('myFrame');
    }
}
