﻿// JScript File

function clickButton(e, buttonid){ 	

    if (window.event) iKeyCode = window.event.keyCode
	else if (e) iKeyCode = e.which;

    //if (buttonid == 'ctl00_lbfind' && document.getElementById("ctl00_tbSearch").value=='Type in what you are looking for...'){
    //    alert("hello");
    //    return false;
    //}
    //else{
        if (iKeyCode == 13){ 
	        __doPostBack(buttonid.replace("_", "$").replace("_", "$"),'')
		    return false; 
	    } 
    //}
}


	
function selectTheText(pagetype,myel){
    //alert("1");
	if(document.getElementById){
	    //alert("2");
	    if(pagetype=='master'){
        temp = document.getElementById("ctl00_" + myel);
        }
        else{
        //alert(myel);
            //alert(myel);
         //temp = document.getElementById("ctl00$ContentPlaceHolder1$" + myel);
         temp=document.getElementById(myel);
        }
            temp.select();
        
    }
}

function numbersOnly(myfield, e, dec) {
    var key;
    var keychar;

    if (window.event)
       key = window.event.keyCode;
    else if (e)
       key = e.which;
    else
       return true;
       
    keychar = String.fromCharCode(key);

    if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27))
       return true;
    else if ((("0123456789").indexOf(keychar) > -1))
       return true;
    else if ((dec=='Y') && (keychar == ".") && (myfield.value.indexOf(keychar) == -1)) {
       return true;
    } else
       return false;
}

function validateRegistration(){
    var contentprefix = "ctl00$ContentPlaceHolder1$";
	var errormsg = '';
	if (document.getElementById(contentprefix + "tbemail").value ==''){errormsg += " - Email\n"};
	//if (document.getElementById(contentprefix + "tbpassword").value ==''){errormsg += " - Password\n"};
	//if (document.getElementById(contentprefix + "tbconfirm").value ==''){errormsg += " - Confirm Password\n"};
	if (document.getElementById(contentprefix + "tbcompanyname").value == '') { errormsg += " - Company/Organisation Name\n" };
	if (document.getElementById(contentprefix + "tbforename").value==''){errormsg += " - First Name\n"};
	if (document.getElementById(contentprefix + "tbsurname").value==''){errormsg += " - Surname\n"};
	if (document.getElementById(contentprefix + "tbaddress1").value==''){errormsg += " - Address Line 1\n"};
	//if (document.getElementById(contentprefix + "tbaddress2").value==''){errormsg += " - Address Line 2\n"};
	if (document.getElementById(contentprefix + "tbaddress4").value==''){errormsg += " - Town/City\n"};
	if (document.getElementById(contentprefix + "tbpostcode").value==''){errormsg += " - Postcode\n"};
	if (document.getElementById(contentprefix + "tbtelephone").value==''){errormsg += " - Telephone\n"};
	if (document.getElementById(contentprefix + "ddwhereheard").options[document.getElementById(contentprefix + "ddwhereheard").selectedIndex].value ==''){errormsg += " - Where Heard\n"};
	if (errormsg != ''){
		alert("Please Complete The Following\n" + errormsg);
		return false;
	}
	else {
		return true;
	}
}

function validateCatReq(){
    var contentprefix = "ctl00$ContentPlaceHolder1$";
	var errormsg = '';
	if (document.getElementById(contentprefix + "tbemail").value ==''){errormsg += " - Email\n"};
	if (document.getElementById(contentprefix + "tbforename").value==''){errormsg += " - First Name\n"};
	if (document.getElementById(contentprefix + "tbsurname").value==''){errormsg += " - Surname\n"};
	if (document.getElementById(contentprefix + "tbaddress1").value==''){errormsg += " - Address Line 1\n"};
	if (document.getElementById(contentprefix + "tbaddress4").value==''){errormsg += " - Town/City\n"};
	if (document.getElementById(contentprefix + "tbpostcode").value==''){errormsg += " - Postcode\n"};
	if (document.getElementById(contentprefix + "tbtelephone").value==''){errormsg += " - Telephone\n"};
	if (document.getElementById(contentprefix + "ddwhereheard").options[document.getElementById(contentprefix + "ddwhereheard").selectedIndex].value ==''){errormsg += " - Where Heard\n"};
	if (errormsg != ''){
		alert("Please Complete The Following\n" + errormsg);
		return false;
	}
	else {
		return true;
	}
}

function validateBRegistration(){
    var contentprefix = "ctl00$ContentPlaceHolder1$";
	var errormsg = '';
	if (document.getElementById(contentprefix + "tbemail").value ==''){errormsg += " - Email\n"};
	if (document.getElementById(contentprefix + "tbName").value==''){errormsg += " - Your Name\n"};
	if (document.getElementById(contentprefix + "tbJobTitle").value==''){errormsg += " - Job title\n"};
    if (document.getElementById(contentprefix + "tbCompany").value==''){errormsg += " - Company Name\n"};
    if (document.getElementById(contentprefix + "tbaddress1").value==''){errormsg += " - Address Line 1\n"};
    if (document.getElementById(contentprefix + "tbaddress2").value==''){errormsg += " - Address Line 2\n"};
	if (document.getElementById(contentprefix + "tbaddress4").value==''){errormsg += " - Town/City\n"};
	if (document.getElementById(contentprefix + "tbpostcode").value==''){errormsg += " - Postcode\n"};
	if (document.getElementById(contentprefix + "tbtelephone").value==''){errormsg += " - Telephone\n"};
	if (document.getElementById(contentprefix + "tbtelephone").value==''){errormsg += " - Telephone\n"};
	if (document.getElementById(contentprefix + "tbEmployeeNumbers").value==''){errormsg += " - No Employees\n"};
	
	
	if (errormsg != ''){
		alert("Please Complete The Following\n" + errormsg);
		return false;
	}
	else {
		return true;
	}
}

function validatePayment(){
	var errorMsg;
	var contentprefix = "ctl00_ContentPlaceHolder1_";
	errorMsg = 'Please Specify The Following:\n';
	if (document.getElementById(contentprefix + "ddPayment").options[document.getElementById(contentprefix + "ddPayment").selectedIndex].value == ' - Please Select - ') {errorMsg += " - Payment Method\n"};
	if (document.getElementById(contentprefix + "ddPayment").options[document.getElementById(contentprefix + "ddPayment").selectedIndex].value == 'Credit/Debit Card') {
		if (document.getElementById(contentprefix + "tbCardNo").value == '') {errorMsg += " - Card No.\n"};
		if (document.getElementById(contentprefix + "tbCardholder").value == '') {errorMsg += " - Card Holder.\n"};
		if (document.getElementById(contentprefix + "ddExpMonth").options[document.getElementById(contentprefix + "ddExpMonth").selectedIndex].value == '--') {errorMsg += " - Expiry Month\n"};
		if (document.getElementById(contentprefix + "ddExpMonth").options[document.getElementById(contentprefix + "ddExpYear").selectedIndex].value == '--') {errorMsg += " - Expiry Year\n"};
	    if (document.getElementById(contentprefix + "tbCVC").value == '') {errorMsg += " - CVC.\n"};
	}
	if (errorMsg == 'Please Specify The Following:\n') {return true} else {alert(errorMsg);return false} 
}

function bookmarksite(title, url){
	if (document.all)
	window.external.AddFavorite(url, title);
	else if (window.sidebar)
	window.sidebar.addPanel(title, url, "")
}

function AddRow(section){
    var i=0;
    for (i=0;i<=20;i++){
        if (document.getElementById(section + i)){
            if (document.getElementById(section + i).style.display=='none'){
                document.getElementById(section + i).style.display='';
                break;
            }
        }
        else{
            break;
        }
    }
}
 
function RemoveRow(section){
    var i=20;
    for (i=20;i>=0;i--){
        if (document.getElementById(section + i)){
            if (document.getElementById(section + i).style.display==''){
                document.getElementById(section + i).style.display='none';
                break;
            }
        }
    }
}
function isMaxLength(txtBox, LENGTH_TEXT) {
    if(txtBox) {
        return ( txtBox.value.length <= LENGTH_TEXT );
     }

}

function mainNavChangeState(id, state) {
    var el = document.getElementById(id);
    
    if (el) {
        state == 'on' ? el.className = 'active' : el.className = '';
    }
}


// ---------- START: Change Tabs (Product Info page) ----------

function setActiveTab(activeTab) {
        var links = ['details', 'directions', 'benefits', 'reviews'];
        var tabs = ['tabDetails', 'tabDirections', 'tabBenefits', 'tabReviews'];
        var elLink = "";
        var elTab = "";
        
        if (links.length == tabs.length) {
            for (var i = 0; i < tabs.length; i += 1) {
                elLink = document.getElementById(links[i]);
                elTab = document.getElementById(tabs[i]);

                if (elTab) {
                    if (activeTab == tabs[i]) {
                        elLink.className = links[i] + "-active"; 
                        elTab.className = "display";
                    }
                    else {
                        try {
                            elLink.className = links[i];
                            elTab.className = "hide";
                        }
                        catch (err) { }
                    }
                }
            }
        }  
    }
    
 // ---------- END: Change Tabs (Product Info page) ----------   

function rating(action, id, id2) {
    var el = document.getElementById(id); 
    var el2 = document.getElementById(id2); 
    
    if ((el) && (el2)) {
        if (action == 'over') {
            el.style.display = 'none';
            el2.style.display = 'block';
        }
        else {
            el.style.display = 'block';
            el2.style.display = 'none';
        }
    }
}


// ---------- START: REVIEWS ----------

    var ajaxReview
    
    function writeReview() {  
        //Effect.ScrollTo('new-review');
        jumpToReviews('write-review');
        toggleNewReview('show');
    }
    
    function jumpToReviews(id) {
        setActiveTab('tabReviews');
        window.location.href = '#' + id; 
    }
    
    function toggleNewReview(action) {
        action == "show" ? Effect.SlideDown('new-review') : Effect.SlideUp('new-review');     
    }
    
     function changeRating(action, id) {
        var rating = $('rating');
        var messages = $('rating-messages') ?  $('rating-messages').value.split(',') : "";
        var message = $('rating-message');
        var star = "";
            
        
        if (rating && rating.value == "") {  // only change images if no counter is set
            for (var i = 1; i <= parseInt(id); i++) {
                star = $('star-' + i.toString());
                
                if (star && action == 'over') {
                    star.className = 'star-over';
                    i - 1 < messages.length && message ? message.innerHTML = messages[i -1] : '';
                }    
                else if (star && action == 'out') {
                    star.className = 'star-blank';
                    message.innerHTML = '';
                }
                else {
                    break;
                }
            }
        }        
    }
    
    function setRating(id) {
        var rating = $('rating');
        
        if (rating) {
            if (rating.value == "") {
                rating.value = id;        
            }
            else {
                rating.value = "";
                changeRating("out", "99");
            }
        }
    }
    
     

function saveReview() {
    var reviewer_rating = '';
    var reviewer_name = '';
    var reviewer_message = '';
    var buyer_id = '';
    var company_id = '';
    var catalogue_ref = '';
    var reviewer_gender = '';
    var reviewer_age = '';
    var baselink = '';
    
    document.getElementById('rating') ? reviewer_rating = document.getElementById('rating').value : '';
    document.getElementById('ctl00_ContentPlaceHolder1_reviewName') ? reviewer_name = document.getElementById('ctl00_ContentPlaceHolder1_reviewName').value : '';
    document.getElementById('ctl00_ContentPlaceHolder1_reviewMessage') ? reviewer_message = document.getElementById('ctl00_ContentPlaceHolder1_reviewMessage').value : '';
    document.getElementById('ctl00_ContentPlaceHolder1_hfBuyerID') ? buyer_id = document.getElementById('ctl00_ContentPlaceHolder1_hfBuyerID').value : '';
    document.getElementById('ctl00_ContentPlaceHolder1_hfCompanyID') ? company_id = document.getElementById('ctl00_ContentPlaceHolder1_hfCompanyID').value : '';
    document.getElementById('ctl00_ContentPlaceHolder1_hfCatalogueRef') ? catalogue_ref = document.getElementById('ctl00_ContentPlaceHolder1_hfCatalogueRef').value : '';
 
    // get gender
    if ((document.getElementById('ctl00_ContentPlaceHolder1_rbReviewGenderF')) && (document.getElementById('ctl00_ContentPlaceHolder1_rbReviewGenderM'))) {
        if (document.getElementById('ctl00_ContentPlaceHolder1_rbReviewGenderF').checked) {
            reviewer_gender = "female";
        }
        else if (document.getElementById('ctl00_ContentPlaceHolder1_rbReviewGenderM').checked) {
            reviewer_gender = "male";
        }
    }
    
    // get age
    if (document.getElementById('ctl00_ContentPlaceHolder1_ddReviewAge')) {
        reviewer_age = document.getElementById('ctl00_ContentPlaceHolder1_ddReviewAge').options[document.getElementById('ctl00_ContentPlaceHolder1_ddReviewAge').selectedIndex].text
    }
 
    if (validateReview(reviewer_rating, reviewer_name, reviewer_message, reviewer_age, reviewer_gender)) { } else { return false; }
   
    // get baselink 
    document.getElementById('ctl00_hfBaselink') ? baselink = document.getElementById('ctl00_hfBaselink').value : '';
    
    ajaxReview = new sack();  
	ajaxReview.requestFile = baselink + "writeProductReview.aspx";
	ajaxReview.setVar('reviewer_rating',reviewer_rating);
	ajaxReview.setVar('reviewer_name',reviewer_name);
	ajaxReview.setVar('reviewer_gender', reviewer_gender);
	ajaxReview.setVar('reviewer_age', reviewer_age);
	ajaxReview.setVar('reviewer_message',reviewer_message);
	ajaxReview.setVar('buyer_id',buyer_id);
	ajaxReview.setVar('company_id',company_id);
	ajaxReview.setVar('catalogue_ref',catalogue_ref);
	ajaxReview.onCompletion = whenReviewCompleted;
	ajaxReview.runAJAX();
	
}

function whenReviewCompleted(){

    var response = ajaxReview.response;
    
    if (ajaxReview.response == '0') {
        document.getElementById('reviewFailed') ? document.getElementById('reviewFailed').style.display = 'block' : '';
    }
    else {
        document.getElementById('reviewSuccess') ? document.getElementById('reviewSuccess').style.display = 'block' : '';
    }  
    
    Element.hide('new-review');
    Element.show('review-complete');  
}

function validateReview(rating, name, message, age, gender) {
    var result = true;
    if (rating == '') {
        document.getElementById('reviewErrorRating') ? document.getElementById('reviewErrorRating').style.display = 'block' : '';
        result = false;
    }
    else {
        document.getElementById('reviewErrorRating') ? document.getElementById('reviewErrorRating').style.display = 'none' : '';
    }
    
    if (name == '') {
        document.getElementById('reviewErrorName') ? document.getElementById('reviewErrorName').style.display = 'block' : '';
        result = false;
    }
    else {
        document.getElementById('reviewErrorName') ? document.getElementById('reviewErrorName').style.display = 'none' : '';
    }
    
    if (message == '') {
        document.getElementById('reviewErrorMessage') ? document.getElementById('reviewErrorMessage').style.display = 'block' : '';
        result = false;
    }
    else {
        document.getElementById('reviewErrorMessage') ? document.getElementById('reviewErrorMessage').style.display = 'none' : '';
    }
//  
//    if ((age == '-- Your Age --') || (age == '')) {
//        document.getElementById('reviewErrorAge') ? document.getElementById('reviewErrorAge').style.display = 'block' : '';
//        result = false;
//    }
//    else {
//        document.getElementById('reviewErrorAge') ? document.getElementById('reviewErrorAge').style.display = 'none' : '';
//    }
    
    
    if (gender == '') {
        document.getElementById('reviewErrorGender') ? document.getElementById('reviewErrorGender').style.display = 'block' : '';
        result = false;
    }
    else {
        document.getElementById('reviewErrorGender') ? document.getElementById('reviewErrorGender').style.display = 'none' : '';
    }    

    return result
}

// ---------- END: REVIEWS ----------

var endcount = 10;
function addlines(linecount){
    var contentprefix = "ctl00_ContentPlaceHolder1_";
    
    var lineno = "";
    
    for (var x = endcount+1; x <= endcount+linecount ; x++){
       if (x<=20){
       document.getElementById("ctl00_ContentPlaceHolder1_rptquickitems_ctl" + padleft(x,"0",2) + "_trquickorder").style.display='';
       }
    }
    endcount = endcount + linecount;
}

function padleft(val, ch, num) {
    var re = new RegExp(".{" + num + "}$");
    var pad = "";
    if (!ch) ch = " ";
    do  {
        pad += ch;
    }while(pad.length < num);
    return re.exec(pad + val);
}


/* sai_ss - textual numbers function preloadctrl(a) { if (typeof a == "string") { var b = new Image(); b.src = a } } if (document.images && typeof preload_ctrl_images != "undefined" && preload_ctrl_images) { var ctrlimgs = [previmg, stopimg, playimg, nextimg]; for (var i_tem = 0; i_tem < ctrlimgs.length; i_tem++) { if (ctrlimgs[i_tem]) { preloadctrl(ctrlimgs[i_tem]) } } } var iss = []; function inter_slide() { if (!document.images || arguments.length == 0) { return } var g = arguments[0]; var c = null, a = null, b = null; if (arguments.length == 2) { b = arguments[1] } else { if (arguments.length == 3 || arguments.length == 4) { c = arguments[1], a = arguments[2], b = arguments[3] ? arguments[3] : null } } this.dom = (document.getElementById); this.da = document.all; this.delay = g.delay ? g.delay : b ? b : 3000 + iss.length * 750; this.nextimgidx = 0; iss[this.issid = iss.length] = this; this.imgs = g; if (g.random) { this.imgs.sort(function() { return 0.5 - Math.random() }) } this.imgborder = g.border ? parseInt(g.border) : 0; if (!this.dom) { this.postimgs = new Array(); for (p = 0; p < g.length; p++) { this.postimgs[p] = new Image(); this.postimgs[p].src = this.imgs[p][0] } } if (this.dom) { this.faded = 0; this.loadimgidx = []; this.fade = !g.nofade; if (this.fade) { this.degree = 10 } this.pausecheck = g.pause; this.mouseovercheck = 0; this.canvasbase = "canvas" + this.issid; this.curcanvas = this.canvasbase + "_0"; this.descriptions = !g.no_descriptions; this.man_start = g.manual_start; this.addbr = !g.no_added_linebreaks; this.no_auto = g.no_auto; this.onclick = g.onclick; this.specs = g.specs; this.counter = g.counter; this.ics = g.image_controls; this.jumpto = g.jumpto; this.no_c = g.no_controls; this.target = g.target; this.ualt = g.use_alt; this.utit = g.use_title; this.fadecolor = g.fadecolor; this.ibut_hc = g.button_highlight; this.dp = g.desc_prefix ? g.desc_prefix : " "; this.imbcolor = g.border_color; this.imbstyle = g.border_style; this.width = g.width ? g.width : c ? c : null; this.width = this.width ? this.width + this.imgborder * 2 : null; this.height = g.height ? g.height : a ? a : null; this.height = this.height ? this.height + this.imgborder * 2 : null; var f = "", e = ""; if (this.width || this.height) { e = this.width && this.height ? "width:" + this.width + "px;height:" + this.height + "px;" : this.width ? "width:" + this.width + "px;" : "height:" + this.height + "px;" } if (this.fade && document.body && document.body.style) { f = document.body.filters ? "filter:progid:DXImageTransform.Microsoft.alpha(opacity=0);" : typeof document.body.style.opacity == "string" ? "opacity:0;" : "opacity:0.10;-moz-opacity:0.10;-khtml-opacity:0.10;" } var d = this.addbr ? "<br>" : ""; if (g.controls_top) { this.controls(); document.write(d) } document.write('<div align="center"><div id="master' + this.issid + '" style="position:relative;' + e + 'overflow:hidden;margin:0 auto;"><div id="' + this.canvasbase + '_0" style="position:absolute;' + e + "top:0;left:0;" + f + "background-color:" + (g.fadecolor ? g.fadecolor : "white") + '"></div><div id="' + this.canvasbase + '_1" style="position:absolute;' + e + "top:0;left:0;" + f + "background-color:" + (g.fadecolor ? g.fadecolor : "white") + '"></div></div></div>'); if (this.descriptions) { document.write(d + '<div align="center">' + this.dp + '<span id="imgdsc' + this.issid + '">&nbsp;</span></div>\n') } if (this.counter && !this.descriptions) { document.write(d) } if (this.counter) { this.cntrl() } if (!g.controls_top) { document.write(this.ics ? "" : d); this.controls() } } else { document.write('<div align="center"><img name="defaultslide' + this.issid + '" src="' + this.postimgs[0].src + '"></div>') } if (this.dom) { this.startit() } else { this.nextimgidx++; setInterval("iss[" + this.issid + "].rotateimg()", this.delay) } } inter_slide.prototype.cntrl = function() { this.cpad = this.imgs.length.toString().length; document.write('<div align="center">Viewing Image: <b><span id="thecnt' + this.issid + '"></span></b> of<span style="font-size:1ex;">&nbsp;</span>&nbsp;<b>' + this.imgs.length + "</b></div>") }; inter_slide.prototype.controls = function() { var a = this.addbr ? "<br>" : " &nbsp;"; if (!this.ics && !this.no_c) { document.write('<div align="center"><input id="prev' + this.issid + '" disabled type="button" value=" << " onclick="iss[' + this.issid + "].changeimg(false, 'nav');\">\n" + (this.no_auto ? "&nbsp;&nbsp;&nbsp;" : ' <input id="gostp' + this.issid + '" type="button" value=" Stop " onclick="iss[' + this.issid + '].gostop(this);">\n') + ' <input id="next' + this.issid + '" disabled type="button" value=" >> " onclick="iss[' + this.issid + "].changeimg(true, 'nav');\">" + (this.jumpto ? a + 'Jump to: <input disabled type="text" size="' + this.imgs.length.toString().length + '" id="goto' + this.issid + '" onkeydown="iss[' + this.issid + '].jumper(event);"><input id="go' + this.issid + '" disabled type="button" onclick="iss[' + this.issid + '].jumper();" value="GO">' : "") + "</div>") } else { if (this.ics && !this.no_c) { var b = document.body.filters ? ' style="filter:alpha(opacity=100);"' : ' style="opacity:' + (this.man_start ? 0.99 : 0.45) + ';"'; document.write('<table align="center" cellpadding="0" cellspacing="10"><tr><td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input' + b + ' onmouseover="iss[' + this.issid + '].ibute(this,1);" onmouseout="iss[' + this.issid + '].ibute(this,2);" onmousedown="iss[' + this.issid + '].ibute(this,3);" onmouseup="iss[' + this.issid + '].ibute(this,4);" type="image" title="Previous" id="prev' + this.issid + '" src="' + previmg + '" onclick="iss[' + this.issid + "].changeimg(false, 'nav');\"></td>" + (this.no_auto ? "<td>&nbsp;</td>" : '<td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input onmouseover="iss[' + this.issid + '].ibute(this,1);" onmouseout="iss[' + this.issid + '].ibute(this,2);" onmousedown="iss[' + this.issid + '].ibute(this,3);" onmouseup="iss[' + this.issid + '].ibute(this,4);" title="Stop" type="image" id="gostp' + this.issid + '" src="' + (this.g_fPlayMode ? playimg : stopimg) + '" onclick="iss[' + this.issid + '].gostop(this);"></td>') + '<td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input' + b + ' onmouseover="iss[' + this.issid + '].ibute(this,1);" onmouseout="iss[' + this.issid + '].ibute(this,2);" onmousedown="iss[' + this.issid + '].ibute(this,3);" onmouseup="iss[' + this.issid + '].ibute(this,4);" type="image" title="Next" id="next' + this.issid + '" src="' + nextimg + '" onclick="iss[' + this.issid + "].changeimg(true, 'nav');\"></td></tr></table>\n") } else { this.no_c = 1 } } }; inter_slide.prototype.jumper = function(c) { var b; if (typeof c == "object") { b = c.keyCode ? c.keyCode : c.which ? c.which : 1 } if (b && b !== 13) { return } var a = typeof c == "number" ? c : parseInt(this.go("goto" + this.issid).value); if (a <= this.imgs.length && a > 0) { this.nextimgidx = a - 2; this.changeimg(true, "jump") } }; inter_slide.prototype.ibute = function(b, a) { if (!b.parentNode) { return } if (a == 1) { b.parentNode.style.backgroundColor = this.ibut_hc ? this.ibut_hc : "yellow" } else { if (a == 2) { b.parentNode.style.backgroundColor = "transparent" } else { if (a == 3) { b.parentNode.style.borderTop = b.parentNode.style.borderLeft = "1px solid gray"; b.parentNode.style.paddingRight = "1px"; b.parentNode.style.paddingBottom = 0 } } } if (a == 2 || a == 4) { b.parentNode.style.borderTop = b.parentNode.style.borderLeft = "none"; b.parentNode.style.paddingRight = "2px"; b.parentNode.style.paddingBottom = "1px" } }; inter_slide.prototype.fadepic = function() { if (this.fade && this.degree < 100) { this.faded = 0; this.degree += 10; if (this.tempobj.filters && this.tempobj.filters[0]) { if (typeof this.tempobj.filters[0].opacity == "number") { this.tempobj.filters[0].opacity = this.degree } else { this.tempobj.style.filter = "alpha(opacity=" + this.degree + ")" } } else { if (this.tempobj.style.MozOpacity) { this.tempobj.style.MozOpacity = this.degree / 101 } else { if (this.tempobj.style.KhtmlOpacity) { this.tempobj.style.KhtmlOpacity = this.degree / 100 } else { if (this.tempobj.style.opacity && !this.tempobj.filters) { this.tempobj.style.opacity = this.degree / 101 } } } } } else { this.faded = 1; clearInterval(this.fadeclear); this.nextcanvas = (this.curcanvas == this.canvasbase + "_0") ? this.canvasbase + "_0" : this.canvasbase + "_1"; this.tempobj = this.go(this.nextcanvas); if (this.playing) { this.changeimg() } } }; inter_slide.prototype.populateslide = function(a, c) { if (document.getElementsByTagName) { if (a.getElementsByTagName("a")[0] && a.getElementsByTagName("a")[0].onclick) { a.getElementsByTagName("a")[0].onclick = null } if (a.getElementsByTagName("img")[0] && a.getElementsByTagName("img")[0].onload) { a.getElementsByTagName("img")[0].onload = null } } a.style.backgroundColor = this.imgs[c].fadecolor ? this.imgs[c].fadecolor : this.fadecolor ? this.fadecolor : "white"; var b = '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td width="100%" height="100%" align="center" valign="middle" style="background:transparent none;">'; if (this.imgs[c][2]) { var d = this.imgs[c][4] ? ", '" + this.imgs[c][4] + "'" : this.specs ? ", '" + this.specs + "'" : ""; b += '<a href="' + this.imgs[c][2] + '"' + (this.imgs[c][3] ? ' target="' + this.imgs[c][3] + '"' : this.target ? ' target="' + this.target + '"' : "") + ' onclick="' + (this.onclick ? this.onclick : "window.open(this.href, (this.target? this.target : '_self')" + d + ");return false;") + '">' } b += '<img id="theimg' + c + "_" + this.issid + '" src="' + (this.loadimgidx[c] && typeof this.loadimgidx[c].complete == "boolean" && this.loadimgidx[c].complete ? this.loadimgidx[c].src : this.imgs[c][0]) + '" alt="' + (this.ualt ? this.imgs[c][1] : "Slide Show Image") + '" title="' + (this.utit ? this.imgs[c][1] : "") + '" ' + (this.imbcolor && !this.imgs[c].noborder ? 'style="border:' + this.imgborder + "px " + (this.imbstyle ? this.imbstyle : "solid") + " " + this.imbcolor + ';"' : 'border="' + (this.imgs[c].noborder ? "0" : this.imgborder) + '"') + (!this.width || !this.height ? ' onload="iss[' + this.issid + '].imgload(this);"' : "") + ">"; if (this.imgs[c][2]) { b += "</a>" } b += "</td></tr></table>"; a.innerHTML = b }; inter_slide.prototype.buttons = function(a) { if (this.no_c) { return } var b = this.go("next" + this.issid), d = this.go("prev" + this.issid); b.disabled = d.disabled = !a; b.title = a ? "next" : ""; d.title = a ? "previous" : ""; if (this.jumpto && !this.ics) { this.go("go" + this.issid).disabled = this.go("goto" + this.issid).disabled = !a } if (this.ics) { if (!this.no_auto) { var c = this.go("gostp" + this.issid); c.title = a ? "Play" : "Stop"; c.src = a ? playimg : stopimg } if (d.filters && d.parentNode) { d.parentNode.style.filter = b.parentNode.style.filter = "alpha(opacity=" + (a ? 100 : 45) + ")" } else { if (d.style.opacity && !d.filters) { d.style.opacity = b.style.opacity = a ? 0.99 : 0.45 } } } }; inter_slide.prototype.imgload = function(c) { if (!c && !this.imgel) { return } var c = c ? c : this.imgel; if (c.width == 0 || c.height == 0) { this.imgel = c; var e = this; clearTimeout(this.getdim); this.getdim = setTimeout(function() { e.imgload() }, 300); return } var a = this.go("master" + this.issid).style, d = this.go(this.canvasbase + "_0").style, b = this.go(this.canvasbase + "_1").style; if (!this.width) { this.width = c.width + this.imgborder * 2; a.width = d.width = b.width = this.width + "px" } if (!this.height) { this.height = c.height + this.imgborder * 2; a.height = d.height = b.height = this.height + "px" } }; inter_slide.prototype.changeimg = function(a, c) { if (this.playing) { this.buttons(false); this.nextimgidx = (this.keeptrack() < this.imgs.length - 1) ? this.keeptrack() + 1 : 0; this.populateslide(this.tempobj, this.nextimgidx); if (a) { this.rotateimg() } else { clearTimeout(this.inprocess); this.inprocess = setTimeout("iss[" + this.issid + "].rotateimg()", this.delay) } } else { if (!this.faded) { if (c && c == "nav") { return } this.nextimgidx = this.keeptrack() + (a ? 1 : -1); this.nextimgidx = (this.nextimgidx < this.imgs.length) ? this.nextimgidx : this.nextimgidx - this.imgs.length; this.nextimgidx = (this.nextimgidx > -1) ? this.nextimgidx : this.imgs.length + this.nextimgidx; return } if (this.fadeclear) { clearInterval(this.fadeclear) } if (a) { var b = this.nextimgidx + 2; b = (b < this.imgs.length) ? b : b - this.imgs.length; b = (b > -1) ? b : this.imgs.length + b; this.loadimgidx[b] = new Image(); this.loadimgidx[b].src = this.imgs[b][0] } else { var b = this.nextimgidx - 2; b = (b < this.imgs.length) ? b : b - this.imgs.length; b = (b > -1) ? b : this.imgs.length + b; this.loadimgidx[b] = new Image(); this.loadimgidx[b].src = this.imgs[b][0] } if (c && c == "jump") { this.nextimgidx++ } else { this.nextimgidx = this.keeptrack() + (a ? 1 : -1) } this.nextimgidx = (this.nextimgidx < this.imgs.length) ? this.nextimgidx : this.nextimgidx - this.imgs.length; this.nextimgidx = (this.nextimgidx > -1) ? this.nextimgidx : this.imgs.length + this.nextimgidx; this.populateslide(this.tempobj, this.nextimgidx); this.rotateimg() } }; inter_slide.prototype.go = function(a) { return this.da ? this.da[a] : document.getElementById(a) }; inter_slide.prototype.rotateimg = function() { if (this.dom) { var j = this.go("theimg" + this.nextimgidx + "_" + this.issid) ? this.go("theimg" + this.nextimgidx + "_" + this.issid) : null; if (j && typeof j.complete == "boolean" && !j.complete) { var c = this; clearTimeout(this.loading); this.loading = setTimeout(function() { c.rotateimg() }, 300); return } if (this.mouseovercheck == 1) { var c = this; clearTimeout(this.mousep); this.mousep = setTimeout(function() { c.rotateimg() }, 100); return } if (this.fade) { this.resetit() } var f = this.tempobj = this.go(this.curcanvas); f.style.zIndex++; var h = this.curcanvas == this.canvasbase + "_0" ? this.go(this.canvasbase + "_1") : this.go(this.canvasbase + "_0"); h.style.zIndex = 0; if (this.descriptions) { this.go("imgdsc" + this.issid).innerHTML = this.imgs[this.keeptrack()][1] } if (this.counter) { var a = ""; for (var b = 0; b < this.cpad - (this.nextimgidx + 1).toString().length; b++) { a += '<span style="visibility:hidden;">0</span>' } this.go("thecnt" + this.issid).innerHTML = a + (this.keeptrack() < this.imgs.length ? this.keeptrack() + 1 : 1) } if (this.go("trace" + this.issid + "_0")) { var i = document.getElementsByTagName("span"), k = new RegExp("trace" + this.issid + "_"); for (var e = 0; e < i.length; e++) { if (k.test(i[e].id)) { i[e].style.color = "#c4c4c4" } } this.go("trace" + this.issid + "_" + this.keeptrack()).style.color = "#FFFFFF" } if (this.jumpto) { this.go("goto" + this.issid).value = this.keeptrack() < this.imgs.length ? this.keeptrack() + 1 : 1 } this.jumperidx = this.keeptrack() < this.imgs.length ? this.keeptrack() + 1 : 1; var g = this; clearInterval(this.fadeclear); this.fadeclear = setInterval(function() { g.fadepic() }, 50); this.curcanvas = (this.curcanvas == this.canvasbase + "_0") ? this.canvasbase + "_1" : this.canvasbase + "_0" } else { var d = document.images["defaultslide" + this.issid]; d.src = this.postimgs[this.nextimgidx].src; this.nextimgidx = (this.nextimgidx < this.imgs.length - 1) ? this.nextimgidx + 1 : 0 } }; inter_slide.prototype.resetit = function() { this.degree = 10; var a = this.go(this.curcanvas); if (a.filters && a.filters[0]) { if (typeof a.filters[0].opacity == "number") { a.filters(0).opacity = this.degree } else { a.style.filter = "alpha(opacity=" + this.degree + ")" } } else { if (a.style.MozOpacity) { a.style.MozOpacity = this.degree / 101 } else { if (a.style.KhtmlOpacity) { a.style.KhtmlOpacity = this.degree / 100 } else { if (a.style.opacity && !a.filters) { a.style.opacity = this.degree / 101 } } } } }; inter_slide.prototype.startit = function() { this.playing = 1; var a = this.go(this.curcanvas); this.populateslide(a, this.nextimgidx); if (this.pausecheck == 1) { var c = this; var b = this.go("master" + this.issid); b.onmouseover = function() { c.mouseovercheck = 1 }; b.onmouseout = function() { c.mouseovercheck = 0 } } this.rotateimg(); if (this.no_auto) { this.gostop() } else { if (this.man_start) { this.gostop(this.go("gostp" + this.issid)) } else { if (this.ics && document.body.filters) { this.buttons(false) } } } }; inter_slide.prototype.gostop = function(a) { if (a) { a.value = a.value == " Stop " ? " Play " : " Stop " } if (this.inprocess && this.playing) { clearTimeout(this.inprocess); this.nextimgidx -= this.faded } this.playing = !this.playing; if (this.playing) { clearInterval(this.fadeclear); this.faded = 1; this.changeimg(true) } else { var b = (this.keeptrack() < this.imgs.length - 1) ? this.keeptrack() + 1 : 0; this.loadimgidx[b] = new Image(); this.loadimgidx[b].src = this.imgs[b][0]; this.jumper(this.jumperidx ? this.jumperidx : 0); this.buttons(true) } }; inter_slide.prototype.keeptrack = function() { if (!document.getElementsByTagName) { return this.nextimgidx } var a = [this.go("canvas" + this.issid + "_0"), this.go("canvas" + this.issid + "_1")]; if (a[0].style.zIndex > a[1].style.zIndex && a[0].getElementsByTagName("img")[0]) { return parseInt(a[0].getElementsByTagName("img")[0].id.replace(/theimg/, "")) } else { if (a[1].getElementsByTagName("img")[0]) { return parseInt(a[1].getElementsByTagName("img")[0].id.replace(/theimg/, "")) } else { return this.nextimgidx } } };

/* sai_ss - this version uses graphical "dots" instead of textual numbers */
function preloadctrl(a) { if (typeof a == "string") { var b = new Image(); b.src = a } } if (document.images && typeof preload_ctrl_images != "undefined" && preload_ctrl_images) { var ctrlimgs = [previmg, stopimg, playimg, nextimg]; for (var i_tem = 0; i_tem < ctrlimgs.length; i_tem++) { if (ctrlimgs[i_tem]) { preloadctrl(ctrlimgs[i_tem]) } } } var iss = []; function inter_slide() { if (!document.images || arguments.length == 0) { return } var g = arguments[0]; var c = null, a = null, b = null; if (arguments.length == 2) { b = arguments[1] } else { if (arguments.length == 3 || arguments.length == 4) { c = arguments[1], a = arguments[2], b = arguments[3] ? arguments[3] : null } } this.dom = (document.getElementById); this.da = document.all; this.delay = g.delay ? g.delay : b ? b : 3000 + iss.length * 750; this.nextimgidx = 0; iss[this.issid = iss.length] = this; this.imgs = g; if (g.random) { this.imgs.sort(function () { return 0.5 - Math.random() }) } this.imgborder = g.border ? parseInt(g.border) : 0; if (!this.dom) { this.postimgs = new Array(); for (p = 0; p < g.length; p++) { this.postimgs[p] = new Image(); this.postimgs[p].src = this.imgs[p][0] } } if (this.dom) { this.faded = 0; this.loadimgidx = []; this.fade = !g.nofade; if (this.fade) { this.degree = 10 } this.pausecheck = g.pause; this.mouseovercheck = 0; this.canvasbase = "canvas" + this.issid; this.curcanvas = this.canvasbase + "_0"; this.descriptions = !g.no_descriptions; this.man_start = g.manual_start; this.addbr = !g.no_added_linebreaks; this.no_auto = g.no_auto; this.onclick = g.onclick; this.specs = g.specs; this.counter = g.counter; this.ics = g.image_controls; this.jumpto = g.jumpto; this.no_c = g.no_controls; this.target = g.target; this.ualt = g.use_alt; this.utit = g.use_title; this.fadecolor = g.fadecolor; this.ibut_hc = g.button_highlight; this.dp = g.desc_prefix ? g.desc_prefix : " "; this.imbcolor = g.border_color; this.imbstyle = g.border_style; this.width = g.width ? g.width : c ? c : null; this.width = this.width ? this.width + this.imgborder * 2 : null; this.height = g.height ? g.height : a ? a : null; this.height = this.height ? this.height + this.imgborder * 2 : null; var f = "", e = ""; if (this.width || this.height) { e = this.width && this.height ? "width:" + this.width + "px;height:" + this.height + "px;" : this.width ? "width:" + this.width + "px;" : "height:" + this.height + "px;" } if (this.fade && document.body && document.body.style) { f = document.body.filters ? "filter:progid:DXImageTransform.Microsoft.alpha(opacity=0);" : typeof document.body.style.opacity == "string" ? "opacity:0;" : "opacity:0.10;-moz-opacity:0.10;-khtml-opacity:0.10;" } var d = this.addbr ? "<br>" : ""; if (g.controls_top) { this.controls(); document.write(d) } document.write('<div align="center"><div id="master' + this.issid + '" style="position:relative;' + e + 'overflow:hidden;margin:0 auto;"><div id="' + this.canvasbase + '_0" style="position:absolute;' + e + "top:0;left:0;" + f + "background-color:" + (g.fadecolor ? g.fadecolor : "white") + '"></div><div id="' + this.canvasbase + '_1" style="position:absolute;' + e + "top:0;left:0;" + f + "background-color:" + (g.fadecolor ? g.fadecolor : "white") + '"></div></div></div>'); if (this.descriptions) { document.write(d + '<div align="center">' + this.dp + '<span id="imgdsc' + this.issid + '">&nbsp;</span></div>\n') } if (this.counter && !this.descriptions) { document.write(d) } if (this.counter) { this.cntrl() } if (!g.controls_top) { document.write(this.ics ? "" : d); this.controls() } } else { document.write('<div align="center"><img name="defaultslide' + this.issid + '" src="' + this.postimgs[0].src + '"></div>') } if (this.dom) { this.startit() } else { this.nextimgidx++; setInterval("iss[" + this.issid + "].rotateimg()", this.delay) } } inter_slide.prototype.cntrl = function () { this.cpad = this.imgs.length.toString().length; document.write('<div align="center">Viewing Image: <b><span id="thecnt' + this.issid + '"></span></b> of<span style="font-size:1ex;">&nbsp;</span>&nbsp;<b>' + this.imgs.length + "</b></div>") }; inter_slide.prototype.controls = function () { var a = this.addbr ? "<br>" : " &nbsp;"; if (!this.ics && !this.no_c) { document.write('<div align="center"><input id="prev' + this.issid + '" disabled type="button" value=" << " onclick="iss[' + this.issid + "].changeimg(false, 'nav');\">\n" + (this.no_auto ? "&nbsp;&nbsp;&nbsp;" : ' <input id="gostp' + this.issid + '" type="button" value=" Stop " onclick="iss[' + this.issid + '].gostop(this);">\n') + ' <input id="next' + this.issid + '" disabled type="button" value=" >> " onclick="iss[' + this.issid + "].changeimg(true, 'nav');\">" + (this.jumpto ? a + 'Jump to: <input disabled type="text" size="' + this.imgs.length.toString().length + '" id="goto' + this.issid + '" onkeydown="iss[' + this.issid + '].jumper(event);"><input id="go' + this.issid + '" disabled type="button" onclick="iss[' + this.issid + '].jumper();" value="GO">' : "") + "</div>") } else { if (this.ics && !this.no_c) { var b = document.body.filters ? ' style="filter:alpha(opacity=100);"' : ' style="opacity:' + (this.man_start ? 0.99 : 0.45) + ';"'; document.write('<table align="center" cellpadding="0" cellspacing="10"><tr><td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input' + b + ' onmouseover="iss[' + this.issid + '].ibute(this,1);" onmouseout="iss[' + this.issid + '].ibute(this,2);" onmousedown="iss[' + this.issid + '].ibute(this,3);" onmouseup="iss[' + this.issid + '].ibute(this,4);" type="image" title="Previous" id="prev' + this.issid + '" src="' + previmg + '" onclick="iss[' + this.issid + "].changeimg(false, 'nav');\"></td>" + (this.no_auto ? "<td>&nbsp;</td>" : '<td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input onmouseover="iss[' + this.issid + '].ibute(this,1);" onmouseout="iss[' + this.issid + '].ibute(this,2);" onmousedown="iss[' + this.issid + '].ibute(this,3);" onmouseup="iss[' + this.issid + '].ibute(this,4);" title="Stop" type="image" id="gostp' + this.issid + '" src="' + (this.g_fPlayMode ? playimg : stopimg) + '" onclick="iss[' + this.issid + '].gostop(this);"></td>') + '<td valign="middle" align="center" style="padding:2px 2px 1px 2px;"><input' + b + ' onmouseover="iss[' + this.issid + '].ibute(this,1);" onmouseout="iss[' + this.issid + '].ibute(this,2);" onmousedown="iss[' + this.issid + '].ibute(this,3);" onmouseup="iss[' + this.issid + '].ibute(this,4);" type="image" title="Next" id="next' + this.issid + '" src="' + nextimg + '" onclick="iss[' + this.issid + "].changeimg(true, 'nav');\"></td></tr></table>\n") } else { this.no_c = 1 } } }; inter_slide.prototype.jumper = function (c) { var b; if (typeof c == "object") { b = c.keyCode ? c.keyCode : c.which ? c.which : 1 } if (b && b !== 13) { return } var a = typeof c == "number" ? c : parseInt(this.go("goto" + this.issid).value); if (a <= this.imgs.length && a > 0) { this.nextimgidx = a - 2; this.changeimg(true, "jump") } }; inter_slide.prototype.ibute = function (b, a) { if (!b.parentNode) { return } if (a == 1) { b.parentNode.style.backgroundColor = this.ibut_hc ? this.ibut_hc : "yellow" } else { if (a == 2) { b.parentNode.style.backgroundColor = "transparent" } else { if (a == 3) { b.parentNode.style.borderTop = b.parentNode.style.borderLeft = "1px solid gray"; b.parentNode.style.paddingRight = "1px"; b.parentNode.style.paddingBottom = 0 } } } if (a == 2 || a == 4) { b.parentNode.style.borderTop = b.parentNode.style.borderLeft = "none"; b.parentNode.style.paddingRight = "2px"; b.parentNode.style.paddingBottom = "1px" } }; inter_slide.prototype.fadepic = function () { if (this.fade && this.degree < 100) { this.faded = 0; this.degree += 10; if (this.tempobj.filters && this.tempobj.filters[0]) { if (typeof this.tempobj.filters[0].opacity == "number") { this.tempobj.filters[0].opacity = this.degree } else { this.tempobj.style.filter = "alpha(opacity=" + this.degree + ")" } } else { if (this.tempobj.style.MozOpacity) { this.tempobj.style.MozOpacity = this.degree / 101 } else { if (this.tempobj.style.KhtmlOpacity) { this.tempobj.style.KhtmlOpacity = this.degree / 100 } else { if (this.tempobj.style.opacity && !this.tempobj.filters) { this.tempobj.style.opacity = this.degree / 101 } } } } } else { this.faded = 1; clearInterval(this.fadeclear); this.nextcanvas = (this.curcanvas == this.canvasbase + "_0") ? this.canvasbase + "_0" : this.canvasbase + "_1"; this.tempobj = this.go(this.nextcanvas); if (this.playing) { this.changeimg() } } }; inter_slide.prototype.populateslide = function (a, c) { if (document.getElementsByTagName) { if (a.getElementsByTagName("a")[0] && a.getElementsByTagName("a")[0].onclick) { a.getElementsByTagName("a")[0].onclick = null } if (a.getElementsByTagName("img")[0] && a.getElementsByTagName("img")[0].onload) { a.getElementsByTagName("img")[0].onload = null } } a.style.backgroundColor = this.imgs[c].fadecolor ? this.imgs[c].fadecolor : this.fadecolor ? this.fadecolor : "white"; var b = '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td width="100%" height="100%" align="center" valign="middle" style="background:transparent none;">'; if (this.imgs[c][2]) { var d = this.imgs[c][4] ? ", '" + this.imgs[c][4] + "'" : this.specs ? ", '" + this.specs + "'" : ""; b += '<a href="' + this.imgs[c][2] + '"' + (this.imgs[c][3] ? ' target="' + this.imgs[c][3] + '"' : this.target ? ' target="' + this.target + '"' : "") + ' onclick="' + (this.onclick ? this.onclick : "window.open(this.href, (this.target? this.target : '_self')" + d + ");return false;") + '">' } b += '<img id="theimg' + c + "_" + this.issid + '" src="' + (this.loadimgidx[c] && typeof this.loadimgidx[c].complete == "boolean" && this.loadimgidx[c].complete ? this.loadimgidx[c].src : this.imgs[c][0]) + '" alt="' + (this.ualt ? this.imgs[c][1] : "Slide Show Image") + '" title="' + (this.utit ? this.imgs[c][1] : "") + '" ' + (this.imbcolor && !this.imgs[c].noborder ? 'style="border:' + this.imgborder + "px " + (this.imbstyle ? this.imbstyle : "solid") + " " + this.imbcolor + ';"' : 'border="' + (this.imgs[c].noborder ? "0" : this.imgborder) + '"') + (!this.width || !this.height ? ' onload="iss[' + this.issid + '].imgload(this);"' : "") + ">"; if (this.imgs[c][2]) { b += "</a>" } b += "</td></tr></table>"; a.innerHTML = b }; inter_slide.prototype.buttons = function (a) { if (this.no_c) { return } var b = this.go("next" + this.issid), d = this.go("prev" + this.issid); b.disabled = d.disabled = !a; b.title = a ? "next" : ""; d.title = a ? "previous" : ""; if (this.jumpto && !this.ics) { this.go("go" + this.issid).disabled = this.go("goto" + this.issid).disabled = !a } if (this.ics) { if (!this.no_auto) { var c = this.go("gostp" + this.issid); c.title = a ? "Play" : "Stop"; c.src = a ? playimg : stopimg } if (d.filters && d.parentNode) { d.parentNode.style.filter = b.parentNode.style.filter = "alpha(opacity=" + (a ? 100 : 45) + ")" } else { if (d.style.opacity && !d.filters) { d.style.opacity = b.style.opacity = a ? 0.99 : 0.45 } } } }; inter_slide.prototype.imgload = function (c) { if (!c && !this.imgel) { return } var c = c ? c : this.imgel; if (c.width == 0 || c.height == 0) { this.imgel = c; var e = this; clearTimeout(this.getdim); this.getdim = setTimeout(function () { e.imgload() }, 300); return } var a = this.go("master" + this.issid).style, d = this.go(this.canvasbase + "_0").style, b = this.go(this.canvasbase + "_1").style; if (!this.width) { this.width = c.width + this.imgborder * 2; a.width = d.width = b.width = this.width + "px" } if (!this.height) { this.height = c.height + this.imgborder * 2; a.height = d.height = b.height = this.height + "px" } }; inter_slide.prototype.changeimg = function (a, c) { if (this.playing) { this.buttons(false); this.nextimgidx = (this.keeptrack() < this.imgs.length - 1) ? this.keeptrack() + 1 : 0; this.populateslide(this.tempobj, this.nextimgidx); if (a) { this.rotateimg() } else { clearTimeout(this.inprocess); this.inprocess = setTimeout("iss[" + this.issid + "].rotateimg()", this.delay) } } else { if (!this.faded) { if (c && c == "nav") { return } this.nextimgidx = this.keeptrack() + (a ? 1 : -1); this.nextimgidx = (this.nextimgidx < this.imgs.length) ? this.nextimgidx : this.nextimgidx - this.imgs.length; this.nextimgidx = (this.nextimgidx > -1) ? this.nextimgidx : this.imgs.length + this.nextimgidx; return } if (this.fadeclear) { clearInterval(this.fadeclear) } if (a) { var b = this.nextimgidx + 2; b = (b < this.imgs.length) ? b : b - this.imgs.length; b = (b > -1) ? b : this.imgs.length + b; this.loadimgidx[b] = new Image(); this.loadimgidx[b].src = this.imgs[b][0] } else { var b = this.nextimgidx - 2; b = (b < this.imgs.length) ? b : b - this.imgs.length; b = (b > -1) ? b : this.imgs.length + b; this.loadimgidx[b] = new Image(); this.loadimgidx[b].src = this.imgs[b][0] } if (c && c == "jump") { this.nextimgidx++ } else { this.nextimgidx = this.keeptrack() + (a ? 1 : -1) } this.nextimgidx = (this.nextimgidx < this.imgs.length) ? this.nextimgidx : this.nextimgidx - this.imgs.length; this.nextimgidx = (this.nextimgidx > -1) ? this.nextimgidx : this.imgs.length + this.nextimgidx; this.populateslide(this.tempobj, this.nextimgidx); this.rotateimg() } }; inter_slide.prototype.go = function (a) { return this.da ? this.da[a] : document.getElementById(a) }; inter_slide.prototype.rotateimg = function () { if (this.dom) { var j = this.go("theimg" + this.nextimgidx + "_" + this.issid) ? this.go("theimg" + this.nextimgidx + "_" + this.issid) : null; if (j && typeof j.complete == "boolean" && !j.complete) { var c = this; clearTimeout(this.loading); this.loading = setTimeout(function () { c.rotateimg() }, 300); return } if (this.mouseovercheck == 1) { var c = this; clearTimeout(this.mousep); this.mousep = setTimeout(function () { c.rotateimg() }, 100); return } if (this.fade) { this.resetit() } var f = this.tempobj = this.go(this.curcanvas); f.style.zIndex++; var h = this.curcanvas == this.canvasbase + "_0" ? this.go(this.canvasbase + "_1") : this.go(this.canvasbase + "_0"); h.style.zIndex = 0; if (this.descriptions) { this.go("imgdsc" + this.issid).innerHTML = this.imgs[this.keeptrack()][1] } if (this.counter) { var a = ""; for (var b = 0; b < this.cpad - (this.nextimgidx + 1).toString().length; b++) { a += '<span style="visibility:hidden;">0</span>' } this.go("thecnt" + this.issid).innerHTML = a + (this.keeptrack() < this.imgs.length ? this.keeptrack() + 1 : 1) } if (this.go("trace" + this.issid + "_0")) { var i = document.getElementsByTagName("span"), k = new RegExp("trace" + this.issid + "_"); for (var e = 0; e < i.length; e++) { if (k.test(i[e].id)) { i[e].innerHTML = "<img src='" + document.getElementById('ctl00_hfBaselink').value + "images/banner-off.png' />" } } this.go("trace" + this.issid + "_" + this.keeptrack()).innerHTML = "<img src='" + document.getElementById('ctl00_hfBaselink').value + "images/banner-on.png' />" } if (this.jumpto) { this.go("goto" + this.issid).value = this.keeptrack() < this.imgs.length ? this.keeptrack() + 1 : 1 } this.jumperidx = this.keeptrack() < this.imgs.length ? this.keeptrack() + 1 : 1; var g = this; clearInterval(this.fadeclear); this.fadeclear = setInterval(function () { g.fadepic() }, 50); this.curcanvas = (this.curcanvas == this.canvasbase + "_0") ? this.canvasbase + "_1" : this.canvasbase + "_0" } else { var d = document.images["defaultslide" + this.issid]; d.src = this.postimgs[this.nextimgidx].src; this.nextimgidx = (this.nextimgidx < this.imgs.length - 1) ? this.nextimgidx + 1 : 0 } }; inter_slide.prototype.resetit = function () { this.degree = 10; var a = this.go(this.curcanvas); if (a.filters && a.filters[0]) { if (typeof a.filters[0].opacity == "number") { a.filters(0).opacity = this.degree } else { a.style.filter = "alpha(opacity=" + this.degree + ")" } } else { if (a.style.MozOpacity) { a.style.MozOpacity = this.degree / 101 } else { if (a.style.KhtmlOpacity) { a.style.KhtmlOpacity = this.degree / 100 } else { if (a.style.opacity && !a.filters) { a.style.opacity = this.degree / 101 } } } } }; inter_slide.prototype.startit = function () { this.playing = 1; var a = this.go(this.curcanvas); this.populateslide(a, this.nextimgidx); if (this.pausecheck == 1) { var c = this; var b = this.go("master" + this.issid); b.onmouseover = function () { c.mouseovercheck = 1 }; b.onmouseout = function () { c.mouseovercheck = 0 } } this.rotateimg(); if (this.no_auto) { this.gostop() } else { if (this.man_start) { this.gostop(this.go("gostp" + this.issid)) } else { if (this.ics && document.body.filters) { this.buttons(false) } } } }; inter_slide.prototype.gostop = function (a) { if (a) { a.value = a.value == " Stop " ? " Play " : " Stop " } if (this.inprocess && this.playing) { clearTimeout(this.inprocess); this.nextimgidx -= this.faded } this.playing = !this.playing; if (this.playing) { clearInterval(this.fadeclear); this.faded = 1; this.changeimg(true) } else { var b = (this.keeptrack() < this.imgs.length - 1) ? this.keeptrack() + 1 : 0; this.loadimgidx[b] = new Image(); this.loadimgidx[b].src = this.imgs[b][0]; this.jumper(this.jumperidx ? this.jumperidx : 0); this.buttons(true) } }; inter_slide.prototype.keeptrack = function () { if (!document.getElementsByTagName) { return this.nextimgidx } var a = [this.go("canvas" + this.issid + "_0"), this.go("canvas" + this.issid + "_1")]; if (a[0].style.zIndex > a[1].style.zIndex && a[0].getElementsByTagName("img")[0]) { return parseInt(a[0].getElementsByTagName("img")[0].id.replace(/theimg/, "")) } else { if (a[1].getElementsByTagName("img")[0]) { return parseInt(a[1].getElementsByTagName("img")[0].id.replace(/theimg/, "")) } else { return this.nextimgidx } } };


// JScript File for TextArea
// Keep user from entering more than maxLength characters
function doKeypress(control){
    maxLength = control.attributes["maxLength"].value;
    value = control.value;
     if(maxLength && value.length > maxLength-1){
          event.returnValue = false;
          maxLength = parseInt(maxLength);
     }
}
// Cancel default behavior
function doBeforePaste(control){
    maxLength = control.attributes["maxLength"].value;
     if(maxLength)
     {
          event.returnValue = false;
     }
}
// Cancel default behavior and create a new paste routine
function doPaste(control){
    maxLength = control.attributes["maxLength"].value;
    value = control.value;
     if(maxLength){
          event.returnValue = false;
          maxLength = parseInt(maxLength);
          var oTR = control.document.selection.createRange();
          var iInsertLength = maxLength - value.length + oTR.text.length;
          var sData = window.clipboardData.getData("Text").substr(0,iInsertLength);
          oTR.text = sData;
     }
}
