/* site_functions.js
 * put site specific javascript functions here
 * is already included in header.tpl
 */

function popup(sPicURL,width,height) {
        window.open(sPicURL, "", "resizable=1,HEIGHT=" + height + ",WIDTH=" + width);
}


// new window popup used for opening up artwork and flash projects
function launchwin(uri,name,args){
	windowReference = window.open(uri,name,args);
	if (!windowReference.opener){
		windowReference.opener = self;
	}
	windowReference.focus();
}

function showFullReview(elementId){
	if(document.getElementById(elementId)){
		document.getElementById(elementId).style.height='auto';
		document.getElementById(elementId).style.overflow='auto';
	}
}

function showTellAFriendForm(title, uri, productId){
    launchwin('tellafriend.html?productId='+productId+'&title='+title+'&uri='+uri, 'Tell A Friend', 'width=300,height=275');
}

function showReviewForm(){
	// not using this
	if(document.getElementById("reviewForm")){
		var reviewForm = document.getElementById("reviewForm");
		reviewForm.style.visibility = "visible";
		reviewForm.style.display = "block";
		reviewForm.style.height = "auto";
	}
}

function useAddress(count){
    document.getElementById("address").value = document.getElementById(count+"address").innerHTML;
    if ( document.getElementById(count+"address2") ) {
        document.getElementById("address2").value = document.getElementById(count+"address2").innerHTML;
    }
    else {
        document.getElementById("address2").value = '';
    }
    document.getElementById("city").value = document.getElementById(count+"city").innerHTML;
    document.getElementById("state").value = document.getElementById(count+"state").innerHTML;
    document.getElementById("zip").value = document.getElementById(count+"zip").innerHTML;
}
