﻿
function openFlashSite(hostAddress){
    var winLeft = ( screen.width / 2) - 450;
    var winTop = ( screen.height / 2) - 400;
    var fl_site = window.open("http://reflectionsoftware.com/fl/default.aspx",null,"width=900,height=800,location=no,top=" + winTop + ",left=" + winLeft + ",menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
}

function openDemo(url,w,h){
    var winLeft = ( screen.width / 2) - (w/2);
    var winTop = ( screen.height / 2) - (h/2);
	var tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+w+",height="+h+",top=" + winTop + ",left=" + winLeft;
	var demo = window.open(url, 'demo', tools);
	demo.focus();		
}

function resizeFlash(){
    
    window.flash = document.forms[0].flash;
    
	var flash = document.getElementById("flashContent");
		
	
	if(window.innerWidth){
		//set height
		if(window.innerHeight < 700){
			flash.style.height = 700 + "px";
		}else{
			flash.style.height = window.innerHeight + "px";
		}
		
		//set width
		if(window.innerWidth < 900){
			flash.style.width = 900 + "px";
		}else{
			flash.style.width = window.innerWidth + "px";
		}
	}else{
		
		//this is for ie
		//set height
		if(document.body.clientHeight < 700){
			flash.style.height = 700 + "px";
		}else{
			flash.style.height = document.body.clientHeight + "px";
		}
		
		//set width
		if(document.body.clientWidth < 900){
			flash.style.width = 900 + "px";
		}else{
			flash.style.width = document.body.clientWidth + "px";
		}
	}
	
}

/*function setSessionId(value){
    return document.getElementById("sessionId").value = value;
    alert(document.getElementById("sessionId").value);
}
function getSessionId(){
    
    return document.forms[0].getElementById("sessionId").value;
    if( document.getElementById("sessionId") ){
        return document.forms[0].getElementById("sessionId").value;
    }else{
        return document.getElementById("sessionId").value;
    }
}

function setUserId(value){
    return document.getElementById("userId").value = value;
}
function getUserId(){
    
    if( document.getElementById("userId") ){
        return document.getElementById("userId").value;
    }else{
        return document.getElementById("userId").value;
    }
}
*/


function swapImage(id,img){

    document.getElementById(id).src = img;
}

function clearText(textField,replaceValue){
    
    if( document.getElementById(textField).value == replaceValue){
        document.getElementById(textField).value = "";
    }
}
